home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 2002-10-03 | 165.1 KB | 2,839 lines
sssshhhh((((1111)))) sssshhhh((((1111)))) NNNNAAAAMMMMEEEE _ssss_hhhh_,,,, _rrrr_ssss_hhhh_,,,, _kkkk_ssss_hhhh_,,,, _rrrr_kkkk_ssss_hhhh - a standard/restricted command and programming language SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS _ssss_hhhh [ _----_aaaa_bbbb_CCCC_eeee_ffff_hhhh_iiii_kkkk_mmmm_nnnn_pppp_rrrr_ssss_tttt_uuuu_vvvv_xxxx ] [ _----_oooo _o_p_t_i_o_n ] ... [ _----_cccc _s_t_r_i_n_g ] [ _a_r_g ... ] ////uuuussssrrrr////lllliiiibbbb////rrrrsssshhhh [ _----_aaaa_bbbb_CCCC_eeee_ffff_hhhh_iiii_kkkk_mmmm_nnnn_pppp_rrrr_ssss_tttt_uuuu_vvvv_xxxx ] [ _----_oooo _o_p_t_i_o_n ] ... [ _----_cccc _s_t_r_i_n_g ] [ _a_r_g ... ] DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN NNNNooootttteeee:::: As of IRIX 6.4, _ssss_hhhh is the Korn shell rather than the Bourne shell. See _bbbb_ssss_hhhh(1) for the Bourne Shell description. See the CCCCOOOOMMMMPPPPAAAATTTTIIIIBBBBIIIILLLLIIIITTTTYYYY IIIISSSSSSSSUUUUEEEESSSS section below for more detail. This is the internationalized _ssss_hhhh. See the _IIII_NNNN_TTTT_EEEE_RRRR_NNNN_AAAA_TTTT_IIII_OOOO_NNNN_AAAA_LLLL_IIII_ZZZZ_AAAA_TTTT_IIII_OOOO_NNNN section below for more detail. _ssss_hhhh is a command and programming language that executes commands read from a terminal or a file. _////_uuuu_ssss_rrrr_////_llll_iiii_bbbb_////_rrrr_ssss_hhhh (also invoked as _rrrr_kkkk_ssss_hhhh) is a restricted version of the standard command interpreter _ssss_hhhh; it is used to set up login names and execution environments whose capabilities are more controlled than those of the standard shell. See IIIInnnnvvvvooooccccaaaattttiiiioooonnnn below for the meaning of arguments to the shell. DDDDeeeeffffiiiinnnniiiittttiiiioooonnnnssss A _m_e_t_a_c_h_a_r_a_c_t_e_r is one of the following characters: _;;;; _&&&& _(((( _)))) _|||| _<<<< _>>>> newline space tab A _b_l_a_n_k is a tab or a space. An _i_d_e_n_t_i_f_i_e_r is a sequence of letters, digits, or underscores starting with a letter or underscore. Identifiers are used as names for _f_u_n_c_t_i_o_n_s and _v_a_r_i_a_b_l_e_s. A _w_o_r_d is a sequence of _c_h_a_r_a_c_t_e_r_s separated by one or more non-quoted _m_e_t_a_c_h_a_r_a_c_t_e_r_s. A _c_o_m_m_a_n_d is a sequence of characters in the syntax of the shell language. The shell reads each command and carries out the desired action either directly or by invoking separate utilities. A special command is a command that is carried out by the shell without creating a separate process. Except for documented side effects, most special commands can be implemented as separate utilities. CCCCoooommmmmmmmaaaannnnddddssss A _s_i_m_p_l_e-_c_o_m_m_a_n_d is a sequence of _b_l_a_n_k separated words which may be preceded by a variable assignment list (see EEEEnnnnvvvviiiirrrroooonnnnmmmmeeeennnntttt below). The first word specifies the name of the command to be executed. Except as specified below, the remaining words are passed as arguments to the invoked command. The command name is passed as argument 0 [see _eeee_xxxx_eeee_cccc(2)]. The _v_a_l_u_e of a simple-command is its exit status if it terminates normally, or (octal) 200+_s_t_a_t_u_s if it terminates abnormally [see _ssss_iiii_gggg_nnnn_aaaa_llll(2) for a list of _s_t_a_t_u_s values]. PPPPaaaaggggeeee 1111 sssshhhh((((1111)))) sssshhhh((((1111)))) A _p_i_p_e_l_i_n_e is a sequence of one or more _c_o_m_m_a_n_d_s separated by _||||. The standard output of each command but the last is connected by a _pppp_iiii_pppp_eeee(2) to the standard input of the next command. Each command is run as a separate process; the shell waits for the last command to terminate. The exit status of a pipeline is the exit status of the last command. A _l_i_s_t is a sequence of one or more pipelines separated by _;;;;, _&&&&, _&&&&_&&&&, or _||||_||||, and optionally terminated by _;;;;, _&&&&, or _||||_&&&&. Of these five symbols, _;;;;, _&&&&, and _||||_&&&& have equal precedence, which is lower than that of _&&&&_&&&& and _||||_||||. The symbols _&&&&_&&&& and _||||_|||| also have equal precedence. A semicolon (_;;;;) causes sequential execution of the preceding pipeline; an ampersand (_&&&&) causes asynchronous execution of the preceding pipeline (that is, the shell does not wait for that pipeline to finish). The symbol _||||_&&&& causes asynchronous execution of the preceding command or pipeline with a two-way pipe established to the parent shell. The standard input and output of the spawned command can be written to and read from by the parent shell using the _----_pppp option of the special commands _rrrr_eeee_aaaa_dddd and _pppp_rrrr_iiii_nnnn_tttt described later. The symbol _&&&&_&&&& (_||||_||||) causes the _l_i_s_t following it to be executed only if the preceding pipeline returns a zero (nonzero) value. An arbitrary number of newlines may appear in a _l_i_s_t, instead of a semicolon, to delimit a command. A _c_o_m_m_a_n_d is either a simple-command or one of the following. Unless otherwise stated, the value returned by a command is that of the last simple-command executed in the command. _ffff_oooo_rrrr _i_d_e_n_t_i_f_i_e_r [ _iiii_nnnn _w_o_r_d ... ] _;;;; _dddd_oooo _l_i_s_t _;;;; _dddd_oooo_nnnn_eeee Each time a _ffff_oooo_rrrr command is executed, _i_d_e_n_t_i_f_i_e_r is set to the next _w_o_r_d taken from the _iiii_nnnn _w_o_r_d list. If _iiii_nnnn _w_o_r_d ... is omitted, the _ffff_oooo_rrrr command executes the _dddd_oooo _l_i_s_t once for each positional parameter that is set (see PPPPaaaarrrraaaammmmeeeetttteeeerrrr SSSSuuuubbbbssssttttiiiittttuuuuttttiiiioooonnnn below). Execution ends when there are no more words in the list. _ssss_eeee_llll_eeee_cccc_tttt _i_d_e_n_t_i_f_i_e_r [ _iiii_nnnn _w_o_r_d ... ] _;;;; _dddd_oooo _l_i_s_t _;;;; _dddd_oooo_nnnn_eeee A _ssss_eeee_llll_eeee_cccc_tttt command prints on standard error (file descriptor 2), the set of _w_o_r_ds, each preceded by a number. If _iiii_nnnn _w_o_r_d ... is omitted, the positional parameters are used instead (see PPPPaaaarrrraaaammmmeeeetttteeeerrrr SSSSuuuubbbbssssttttiiiittttuuuuttttiiiioooonnnn below). The _PPPP_SSSS_3333 prompt is printed and a line is read from the standard input. If this line consists of the number of one of the listed _w_o_r_ds, the value of the parameter _i_d_e_n_t_i_f_i_e_r is set to the _w_o_r_d corresponding to this number. If this line is empty the selection list is printed again. Otherwise the value of the parameter _i_d_e_n_t_i_f_i_e_r is set to _nnnn_uuuu_llll_llll. The contents of the line read from standard input is saved in the variable _RRRR_EEEE_PPPP_LLLL_YYYY_.... The _l_i_s_t is executed for each selection until a _bbbb_rrrr_eeee_aaaa_kkkk or end-of-file is encountered. _cccc_aaaa_ssss_eeee _w_o_r_d _iiii_nnnn [ [_((((]_p_a_t_t_e_r_n [ | _p_a_t_t_e_r_n ] ... _)))) _l_i_s_t _;;;;_;;;; ] ... _eeee_ssss_aaaa_cccc A _cccc_aaaa_ssss_eeee command executes the _l_i_s_t associated with the first _p_a_t_t_e_r_n that matches _w_o_r_d. The form of the patterns is the same as that used for file-name generation (see FFFFiiiilllleeeennnnaaaammmmeeee GGGGeeeennnneeeerrrraaaattttiiiioooonnnn below). PPPPaaaaggggeeee 2222 sssshhhh((((1111)))) sssshhhh((((1111)))) _iiii_ffff _l_i_s_t _;;;; _tttt_hhhh_eeee_nnnn _l_i_s_t [ _eeee_llll_iiii_ffff _l_i_s_t _;;;; _tttt_hhhh_eeee_nnnn _l_i_s_t ] ... [ _;;;; _eeee_llll_ssss_eeee _l_i_s_t ] _;;;; _ffff_iiii The _l_i_s_t following _iiii_ffff is executed and, if it returns a zero exit status, the _l_i_s_t following the first _tttt_hhhh_eeee_nnnn is executed. Otherwise, the _l_i_s_t following _eeee_llll_iiii_ffff is executed and, if its value is zero, the _l_i_s_t following the next _tttt_hhhh_eeee_nnnn is executed. Failing that, the _eeee_llll_ssss_eeee _l_i_s_t is executed. If no _eeee_llll_ssss_eeee _l_i_s_t or _tttt_hhhh_eeee_nnnn _l_i_s_t is executed, the _iiii_ffff command returns a zero exit status. _wwww_hhhh_iiii_llll_eeee _l_i_s_t _;;;; _dddd_oooo _l_i_s_t _;;;; _dddd_oooo_nnnn_eeee _uuuu_nnnn_tttt_iiii_llll _l_i_s_t _;;;; _dddd_oooo _l_i_s_t _;;;; _dddd_oooo_nnnn_eeee A _wwww_hhhh_iiii_llll_eeee command repeatedly executes the _wwww_hhhh_iiii_llll_eeee _l_i_s_t and, if the exit status of the last command in the list is zero, executes the _dddd_oooo _l_i_s_t; otherwise the loop terminates. If no commands in the _dddd_oooo _l_i_s_t are executed, the _wwww_hhhh_iiii_llll_eeee command returns a zero exit status; _uuuu_nnnn_tttt_iiii_llll may be used in place of _wwww_hhhh_iiii_llll_eeee to negate the loop termination test. _((((_l_i_s_t_)))) Execute _l_i_s_t in a separate environment. Note, that if two adjacent open parentheses are needed for nesting, a space must be inserted to avoid arithmetic evaluation as described below. _{{{{ _l_i_s_t_;;;;_}}}} _l_i_s_t is simply executed. The _{{{{ must be followed by a space. Note that unlike the metacharacters _(((( and _)))), _{{{{ and _}}}} are _r_e_s_e_r_v_e_d _w_o_r_ds and must be typed at the beginning of a line or after a _;;;; in order to be recognized. _[[[[_[[[[_e_x_p_r_e_s_s_i_o_n_]]]]_]]]] Evaluates _e_x_p_r_e_s_s_i_o_n and returns a zero exit status when _e_x_p_r_e_s_s_i_o_n is true. See CCCCoooonnnnddddiiiittttiiiioooonnnnaaaallll EEEExxxxpppprrrreeeessssssssiiiioooonnnnssss below, for a description of _e_x_p_r_e_s_s_i_o_n. _ffff_uuuu_nnnn_cccc_tttt_iiii_oooo_nnnn _i_d_e_n_t_i_f_i_e_r _{{{{ _l_i_s_t_;;;;_}}}} _i_d_e_n_t_i_f_i_e_r _((((_)))) _{{{{ _l_i_s_t_;;;;_}}}} Define a function which is referenced by _i_d_e_n_t_i_f_i_e_r. The body of the function is the _l_i_s_t of commands between _{{{{ and _}}}} (see FFFFuuuunnnnccccttttiiiioooonnnnssss below). The _{{{{ must be followed by a space. _tttt_iiii_mmmm_eeee _p_i_p_e_l_i_n_e The _p_i_p_e_l_i_n_e is executed and the elapsed time as well as the user and system time are printed on standard error. Note that the reported times reflect the elapsed time for both the parent and the child processes in order to give a more accurate view of the total time the _p_i_p_e_l_i_n_e took to execute. The following reserved words are only recognized as the first word of a command and when not quoted: _iiii_ffff _tttt_hhhh_eeee_nnnn _eeee_llll_ssss_eeee _eeee_llll_iiii_ffff _ffff_iiii _cccc_aaaa_ssss_eeee _eeee_ssss_aaaa_cccc _ffff_oooo_rrrr _wwww_hhhh_iiii_llll_eeee _uuuu_nnnn_tttt_iiii_llll _dddd_oooo _dddd_oooo_nnnn_eeee _{{{{ _}}}} _ffff_uuuu_nnnn_cccc_tttt_iiii_oooo_nnnn _ssss_eeee_llll_eeee_cccc_tttt _tttt_iiii_mmmm_eeee _[[[[_[[[[ _]]]]_]]]] PPPPaaaaggggeeee 3333 sssshhhh((((1111)))) sssshhhh((((1111)))) CCCCoooommmmmmmmeeeennnnttttssss A word beginning with _#### causes that word and all the following characters up to a newline to be ignored. AAAAlllliiiiaaaassssiiiinnnngggg The first word of each command is replaced by the text of an _aaaa_llll_iiii_aaaa_ssss if an _aaaa_llll_iiii_aaaa_ssss for this word has been defined. An alias name consists of any number of characters excluding meta-characters, quoting characters, file expansion characters, parameter and command substitution characters and _====. The replacement string can contain any valid shell script including the metacharacters listed above. The first word of each command in the replaced text, other than any that are in the process of being replaced, is tested for aliases. If the last character of the alias value is a _b_l_a_n_k the word following the alias is also checked for alias substitution. Aliases can be used to redefine special builtin commands but cannot be used to redefine the reserved words listed above. Aliases can be created, listed, and exported with the _aaaa_llll_iiii_aaaa_ssss command and can be removed with the _uuuu_nnnn_aaaa_llll_iiii_aaaa_ssss command. Exported aliases remain in effect for scripts invoked by name, but must be reinitialized for separate invocations of the shell (see IIIInnnnvvvvooooccccaaaattttiiiioooonnnn below). _A_l_i_a_s_i_n_g is performed when scripts are read, not while they are executed. Therefore, for an alias to take effect the _aaaa_llll_iiii_aaaa_ssss definition command has to be executed before the command which references the alias is read. Aliases are frequently used as a short hand for full pathnames. An option to the aliasing facility allows the value of the alias to be automatically set to the full pathname of the corresponding command. These aliases are called tracked aliases. The value of a tracked alias is defined the first time the corresponding command is looked up and becomes undefined each time the _PPPP_AAAA_TTTT_HHHH variable is reset. These aliases remain tracked so that the next subsequent reference redefines the value. Several tracked aliases are compiled into the shell. The _----_hhhh option of the _ssss_eeee_tttt command makes each referenced command name into a tracked alias. The following _e_x_p_o_r_t_e_d _a_l_i_a_s_e_s are compiled into the shell but can be unset or redefined: _aaaa_uuuu_tttt_oooo_llll_oooo_aaaa_dddd_====_''''_tttt_yyyy_pppp_eeee_ssss_eeee_tttt _----_ffff_uuuu_'''' _ffff_aaaa_llll_ssss_eeee_====_''''_llll_eeee_tttt _0000_'''' _ffff_uuuu_nnnn_cccc_tttt_iiii_oooo_nnnn_ssss_====_''''_tttt_yyyy_pppp_eeee_ssss_eeee_tttt _----_ffff_'''' _hhhh_aaaa_ssss_hhhh_====_''''_aaaa_llll_iiii_aaaa_ssss _----_tttt_'''' _hhhh_iiii_ssss_tttt_oooo_rrrr_yyyy_====_''''_ffff_cccc _----_llll_'''' _iiii_nnnn_tttt_eeee_gggg_eeee_rrrr_====_''''_tttt_yyyy_pppp_eeee_ssss_eeee_tttt _----_iiii_'''' _nnnn_oooo_hhhh_uuuu_pppp_====_''''_nnnn_oooo_hhhh_uuuu_pppp _'''' _rrrr_====_''''_ffff_cccc _----_eeee _----_'''' _tttt_rrrr_uuuu_eeee_====_''''_::::_'''' _tttt_yyyy_pppp_eeee_====_''''_wwww_hhhh_eeee_nnnn_cccc_eeee _----_vvvv_'''' PPPPaaaaggggeeee 4444 sssshhhh((((1111)))) sssshhhh((((1111)))) TTTTiiiillllddddeeee SSSSuuuubbbbssssttttiiiittttuuuuttttiiiioooonnnn After alias substitution is performed, each word is checked to see if it begins with an unquoted _~~~~. If it does, the word up to a _//// is checked to see if it matches a user name in the _////_eeee_tttt_cccc_////_pppp_aaaa_ssss_ssss_wwww_dddd file. If a match is found, the _~~~~ and the matched login name is replaced by the login directory of the matched user. This is called a _t_i_l_d_e substitution. If no match is found, the original text is left unchanged. A _~~~~ by itself, or in front of a _////, is replaced by _$$$$_HHHH_OOOO_MMMM_EEEE. A _~~~~ followed by a _++++ or _---- is replaced by _$$$$_PPPP_WWWW_DDDD and _$$$$_OOOO_LLLL_DDDD_PPPP_WWWW_DDDD respectively. In addition, _t_i_l_d_e substitution is attempted when the value of a _v_a_r_i_a_b_l_e _a_s_s_i_g_n_m_e_n_t begins with a _~~~~. Tilde substitution is not supported in all shell invocations. (See the _CCCC_OOOO_MMMM_PPPP_AAAA_TTTT_IIII_BBBB_IIII_LLLL_IIII_TTTT_YYYY _IIII_SSSS_SSSS_UUUU_EEEE_SSSS section at the end of this document.) CCCCoooommmmmmmmaaaannnndddd SSSSuuuubbbbssssttttiiiittttuuuuttttiiiioooonnnn The standard output from a command enclosed in parentheses preceded by a dollar sign ( _$$$$_((((_)))) ) or a pair of grave accents (_````_````) may be used as part or all of a word; trailing newlines are removed. In the second (archaic) form, the string between the quotes is processed for special quoting characters before the command is executed (see QQQQuuuuoooottttiiiinnnngggg below). Not all forms of command substitution are supported in all shell invocations. (See the _CCCC_OOOO_MMMM_PPPP_AAAA_TTTT_IIII_BBBB_IIII_LLLL_IIII_TTTT_YYYY _IIII_SSSS_SSSS_UUUU_EEEE_SSSS section at the end of this document.) The command substitution _$$$$_((((_cccc_aaaa_tttt _ffff_iiii_llll_eeee_)))) can be replaced by the equivalent but faster _$$$$_((((_<<<<_ffff_iiii_llll_eeee_)))). Command substitution of most special commands that do not perform input/output redirection are carried out without creating a separate process. In some shell invocations, an arithmetic expression enclosed in double parentheses and preceded by a dollar sign [_$$$$_((((_((((_))))_))))] is replaced by the value of the arithmetic expression within the double parentheses. (See the _CCCC_OOOO_MMMM_PPPP_AAAA_TTTT_IIII_BBBB_IIII_LLLL_IIII_TTTT_YYYY _IIII_SSSS_SSSS_UUUU_EEEE_SSSS section at the end of this document for more detail.) PPPPaaaarrrraaaammmmeeeetttteeeerrrr SSSSuuuubbbbssssttttiiiittttuuuuttttiiiioooonnnn A _p_a_r_a_m_e_t_e_r is an _i_d_e_n_t_i_f_i_e_r, one or more digits, or any of the characters _****, _@@@@, _####, _????, _----, _$$$$, and _!!!!. A _v_a_r_i_a_b_l_e (a parameter denoted by an identifier) has a _v_a_l_u_e and zero or more _a_t_t_r_i_b_u_t_e_s. _V_a_r_i_a_b_l_e_s can be assigned _vvvv_aaaa_llll_uuuu_eeee_ssss and _a_t_t_r_i_b_u_t_e_s by using the _tttt_yyyy_pppp_eeee_ssss_eeee_tttt special command. The attributes supported by the shell are described later with the _tttt_yyyy_pppp_eeee_ssss_eeee_tttt special command. Exported parameters pass values and attributes to the environment. The shell supports a one-dimensional array facility. An element of an array variable is referenced by a _s_u_b_s_c_r_i_p_t. A _s_u_b_s_c_r_i_p_t is denoted by a _[[[[, followed by an _a_r_i_t_h_m_e_t_i_c _e_x_p_r_e_s_s_i_o_n (see AAAArrrriiiitttthhhhmmmmeeeettttiiiicccc EEEEvvvvaaaalllluuuuaaaattttiiiioooonnnn below) followed by a _]]]]. To assign values to an array, use _ssss_eeee_tttt _----_AAAA _n_a_m_e _v_a_l_u_e _...._...._.... The value of all subscripts must be in the range of 0 through 1023. PPPPaaaaggggeeee 5555 sssshhhh((((1111)))) sssshhhh((((1111)))) Arrays need not be declared. Any reference to a variable with a valid subscript is legal and an array is created if necessary. Referencing an array without a subscript is equivalent to referencing the element zero. The _v_a_l_u_e of a _v_a_r_i_a_b_l_e may also be assigned by writing: _n_a_m_e_====_v_a_l_u_e [ _n_a_m_e_====_v_a_l_u_e ] ... If the integer attribute, _----_iiii, is set for _n_a_m_e the _v_a_l_u_e is subject to arithmetic evaluation as described below. Positional parameters, parameters denoted by a number, may be assigned values with the _ssss_eeee_tttt special command. Parameter _$$$$_0000 is set from argument zero when the shell is invoked. The character _$$$$ is used to introduce substitutable _p_a_r_a_m_e_t_e_r_s. _$$$$_{{{{_p_a_r_a_m_e_t_e_r_}}}} The shell reads all the characters from _$$$$_{{{{ to the matching _}}}} as part of the same word even if it contains braces or metacharacters. The value, if any, of the parameter is substituted. The braces are required when _p_a_r_a_m_e_t_e_r is followed by a letter, digit, or underscore that is not to be interpreted as part of its name or when a variable is subscripted. If _p_a_r_a_m_e_t_e_r is one or more digits it is a positional parameter. A positional parameter of more than one digit must be enclosed in braces. If _p_a_r_a_m_e_t_e_r is _**** or _@@@@, all the positional parameters, starting with _$$$$_1111, are substituted (separated by a field separator character). If an array _i_d_e_n_t_i_f_i_e_r with subscript _**** or _@@@@ is used, the value for each of the elements is substituted (separated by a field separator character). _$$$$_{{{{_####_p_a_r_a_m_e_t_e_r_}}}} If _p_a_r_a_m_e_t_e_r is _**** or _@@@@, the number of positional parameters is substituted. Otherwise, the length of the value of the _p_a_r_a_m_e_t_e_r is substituted. _$$$$_{{{{_####_i_d_e_n_t_i_f_i_e_r_[[[[_****_]]]]_}}}} The number of elements in the array _i_d_e_n_t_i_f_i_e_r is substituted. _$$$$_{{{{_p_a_r_a_m_e_t_e_r_::::_----_w_o_r_d_}}}} If _p_a_r_a_m_e_t_e_r is set and is non-null, substitute its value; otherwise substitute _w_o_r_d. _$$$$_{{{{_p_a_r_a_m_e_t_e_r_::::_====_w_o_r_d_}}}} If _p_a_r_a_m_e_t_e_r is not set or is null, set it to _w_o_r_d; the value of the parameter is substituted. Positional parameters may not be assigned to in this way. _$$$$_{{{{_p_a_r_a_m_e_t_e_r_::::_????_w_o_r_d_}}}} If _p_a_r_a_m_e_t_e_r is set and is non-null, substitute its value; otherwise, print _w_o_r_d and exit from the shell. If _w_o_r_d is omitted, a standard message is printed. PPPPaaaaggggeeee 6666 sssshhhh((((1111)))) sssshhhh((((1111)))) _$$$$_{{{{_p_a_r_a_m_e_t_e_r_::::_++++_w_o_r_d_}}}} If _p_a_r_a_m_e_t_e_r is set and is non-null, substitute _w_o_r_d; otherwise substitute nothing. _$$$$_{{{{_p_a_r_a_m_e_t_e_r_####_p_a_t_t_e_r_n_}}}} _$$$$_{{{{_p_a_r_a_m_e_t_e_r_####_####_p_a_t_t_e_r_n_}}}} If the shell _p_a_t_t_e_r_n matches the beginning of the value of _p_a_r_a_m_e_t_e_r, the value of this substitution is the value of the _p_a_r_a_m_e_t_e_r with the matched portion deleted; otherwise the value of this _p_a_r_a_m_e_t_e_r is substituted. In the first form the smallest matching pattern is deleted and in the second form the largest matching pattern is deleted. _$$$$_{{{{_p_a_r_a_m_e_t_e_r_%%%%_p_a_t_t_e_r_n_}}}} _$$$$_{{{{_p_a_r_a_m_e_t_e_r_%%%%_%%%%_p_a_t_t_e_r_n_}}}} If the shell _p_a_t_t_e_r_n matches the end of the value of _p_a_r_a_m_e_t_e_r, the value of this substitution is the value of the _p_a_r_a_m_e_t_e_r with the matched part deleted; otherwise substitute the value of _p_a_r_a_m_e_t_e_r. In the first form the smallest matching pattern is deleted and in the second form the largest matching pattern is deleted. In the above, _w_o_r_d is not evaluated unless it is to be used as the substituted string, so that, in the following example, _pppp_wwww_dddd is executed only if _dddd is not set or is null: _eeee_cccc_hhhh_oooo _$$$$_{{{{_dddd_::::_----_$$$$_((((_pppp_wwww_dddd_))))_}}}} If the colon (_::::) is omitted from the above expressions, the shell only checks whether _p_a_r_a_m_e_t_e_r is set or not. The following parameters are automatically set by the shell: _#### The number of positional parameters in decimal. _---- Flags supplied to the shell on invocation or by the _ssss_eeee_tttt command. _???? The decimal value returned by the last executed command. _$$$$ The process number of this shell. _____ Initially, the value _____ is an absolute pathname of the shell or script being executed as passed in the _e_n_v_i_r_o_n_m_e_n_t. Subsequently it is assigned the last argument of the previous command. This parameter is not set for commands which are asynchronous. This parameter is also used to hold the name of the matching _MMMM_AAAA_IIII_LLLL file when checking for mail. _!!!! The process number of the last background command invoked. _EEEE_RRRR_RRRR_NNNN_OOOO The value of _e_r_r_n_o as set by the most recently failed system call. This value is system dependent and is intended for debugging purposes. PPPPaaaaggggeeee 7777 sssshhhh((((1111)))) sssshhhh((((1111)))) _LLLL_IIII_NNNN_EEEE_NNNN_OOOO The line number of the current line within the script or function being executed. _OOOO_LLLL_DDDD_PPPP_WWWW_DDDD The previous working directory set by the _cccc_dddd command. _OOOO_PPPP_TTTT_AAAA_RRRR_GGGG The value of the last option argument processed by the _gggg_eeee_tttt_oooo_pppp_tttt_ssss special command. _OOOO_PPPP_TTTT_IIII_NNNN_DDDD The index of the last option argument processed by the _gggg_eeee_tttt_oooo_pppp_tttt_ssss special command. _PPPP_PPPP_IIII_DDDD The process number of the parent of the shell. _PPPP_WWWW_DDDD The present working directory set by the _cccc_dddd command. _RRRR_AAAA_NNNN_DDDD_OOOO_MMMM Each time this variable is referenced, a random integer, uniformly distributed between 0 and 32767, is generated. The sequence of random numbers can be initialized by assigning a numeric value to _RRRR_AAAA_NNNN_DDDD_OOOO_MMMM. _RRRR_EEEE_PPPP_LLLL_YYYY This variable is set by the _ssss_eeee_llll_eeee_cccc_tttt statement and by the _rrrr_eeee_aaaa_dddd special command when no arguments are supplied. _SSSS_EEEE_CCCC_OOOO_NNNN_DDDD_SSSS Each time this variable is referenced, the number of seconds since shell invocation is returned. If this variable is assigned a value, the value returned upon reference is the value that was assigned plus the number of seconds since the assignment. The following variables are used by the shell: _CCCC_DDDD_PPPP_AAAA_TTTT_HHHH The search path for the _cccc_dddd command. _CCCC_OOOO_LLLL_UUUU_MMMM_NNNN_SSSS If this variable is set, the value is used to define the width of the edit window for the shell edit modes and for printing _ssss_eeee_llll_eeee_cccc_tttt lists. _EEEE_DDDD_IIII_TTTT_OOOO_RRRR If the value of this variable ends in _e_m_a_c_s, or _vvvv_iiii and the _VVVV_IIII_SSSS_UUUU_AAAA_LLLL variable is not set, the corresponding option (see special command _ssss_eeee_tttt below) is turned on. _EEEE_NNNN_VVVV If this variable is set, parameter substitution is performed on the value to generate the pathname of the script that will be executed when the _s_h_e_l_l is invoked (see Invocation below). This file is typically used for _a_l_i_a_s and _f_u_n_c_t_i_o_n definitions. _FFFF_CCCC_EEEE_DDDD_IIII_TTTT The default editor name for the _ffff_cccc command. _FFFF_PPPP_AAAA_TTTT_HHHH The search path for function definitions. This path is searched when a function with the _----_uuuu attribute is referenced and when a command is not found. If an executable file is PPPPaaaaggggeeee 8888 sssshhhh((((1111)))) sssshhhh((((1111)))) found, it is read and executed in the current environment. _IIII_FFFF_SSSS Internal field separators (normally space, tab, and newline) used to separate command words that result from command or parameter substitution and for separating words with the special command _rrrr_eeee_aaaa_dddd. The first character of the _IIII_FFFF_SSSS variable is used to separate arguments for the _""""_$$$$_****_"""" substitution (see Quoting below). _HHHH_IIII_SSSS_TTTT_FFFF_IIII_LLLL_EEEE If this variable is set when the shell is invoked, the value is the pathname of the file that is used to store the command history (see Command re-entry below). _HHHH_IIII_SSSS_TTTT_SSSS_IIII_ZZZZ_EEEE If this variable is set when the shell is invoked, the number of previously entered commands that are accessible by this shell is greater than or equal to this number. The default is 128. _HHHH_OOOO_MMMM_EEEE The default argument (home directory) for the _cccc_dddd command. _LLLL_IIII_NNNN_EEEE_SSSS If this variable is set, the value is used to determine the column length for printing _ssss_eeee_llll_eeee_cccc_tttt lists. Select lists print vertically until about two-thirds of _LLLL_IIII_NNNN_EEEE_SSSS lines are filled. _MMMM_AAAA_IIII_LLLL If this variable is set to the name of a mail file _a_n_d the _MMMM_AAAA_IIII_LLLL_PPPP_AAAA_TTTT_HHHH variable is not set, the shell informs the user of arrival of mail in the specified file. _MMMM_AAAA_IIII_LLLL_CCCC_HHHH_EEEE_CCCC_KKKK This variable specifies how often (in seconds) the shell checks for changes in the modification time of any of the files specified by the _MMMM_AAAA_IIII_LLLL_PPPP_AAAA_TTTT_HHHH or _MMMM_AAAA_IIII_LLLL variables. The default value is 600 seconds. When the time has elapsed, the shell checks before issuing the next prompt. _MMMM_AAAA_IIII_LLLL_PPPP_AAAA_TTTT_HHHH A colon ( _:::: ) separated list of filenames. If this variable is set the shell informs the user of any modifications to the specified files that have occurred within the last _MMMM_AAAA_IIII_LLLL_CCCC_HHHH_EEEE_CCCC_KKKK seconds. Each filename can be followed by a _???? and a message that is printed. The message undergoes parameter substitution with the variable, _$$$$_____ defined as the name of the file that has changed. The default message is _yyyy_oooo_uuuu _hhhh_aaaa_vvvv_eeee _mmmm_aaaa_iiii_llll _iiii_nnnn _$$$$_____. _PPPP_AAAA_TTTT_HHHH The search path for commands (see Execution below). The user may not change _PPPP_AAAA_TTTT_HHHH if executing under _rrrr_ssss_hhhh (except in _...._pppp_rrrr_oooo_ffff_iiii_llll_eeee). _PPPP_SSSS_1111 The value of this variable is expanded for parameter substitution to define the primary prompt string which by default is ``_$$$$ ''. The character _!!!! in the primary prompt string is replaced by the _c_o_m_m_a_n_d number (see Command Re- entry below). PPPPaaaaggggeeee 9999 sssshhhh((((1111)))) sssshhhh((((1111)))) _PPPP_SSSS_2222 Secondary prompt string, by default ``_>>>> ''. _PPPP_SSSS_3333 Selection prompt string used within a _ssss_eeee_llll_eeee_cccc_tttt loop, by default ``_####_???? ''. _PPPP_SSSS_4444 The value of this variable is expanded for parameter substitution and precedes each line of an execution trace. If omitted, the execution trace prompt is ``_++++ ''. _SSSS_HHHH_EEEE_LLLL_LLLL The pathname of the _s_h_e_l_l is kept in the environment. At invocation, if the basename of this variable matches the pattern _****_rrrr_****_ssss_hhhh, the shell becomes restricted. _TTTT_MMMM_OOOO_UUUU_TTTT If set to a value greater than zero, the shell terminates if a command is not entered within the prescribed number of seconds after issuing the _PPPP_SSSS_1111 prompt. (Note that the shell can be compiled with a maximum bound for this value which cannot be exceeded.) _VVVV_IIII_SSSS_UUUU_AAAA_LLLL If the value of this variable ends in _e_m_a_c_s, or _vvvv_iiii the corresponding option (see special command _ssss_eeee_tttt below) is turned on. ______XXXX_PPPP_GGGG The value of this variable controls certain features of the shell. The default value is 0 (zero). (See the _CCCC_OOOO_MMMM_PPPP_AAAA_TTTT_IIII_BBBB_IIII_LLLL_IIII_TTTT_YYYY _IIII_SSSS_SSSS_UUUU_EEEE_SSSS section at the end of this document.) The shell gives default values to _PPPP_AAAA_TTTT_HHHH, _PPPP_SSSS_1111, _PPPP_SSSS_2222, _MMMM_AAAA_IIII_LLLL_CCCC_HHHH_EEEE_CCCC_KKKK, ______XXXX_PPPP_GGGG, _TTTT_MMMM_OOOO_UUUU_TTTT and _IIII_FFFF_SSSS. _HHHH_OOOO_MMMM_EEEE, _MMMM_AAAA_IIII_LLLL and _SSSS_HHHH_EEEE_LLLL_LLLL are set by _llll_oooo_gggg_iiii_nnnn(1). BBBBllllaaaannnnkkkk IIIInnnntttteeeerrrrpppprrrreeeettttaaaattttiiiioooonnnn After parameter and command substitution, the results of substitutions are scanned for the field separator characters ( those found in _IIII_FFFF_SSSS ) and split into distinct arguments where such characters are found. Explicit null arguments (_""""_"""" or _''''_'''') are retained. Implicit null arguments (those resulting from _p_a_r_a_m_e_t_e_r_s that have no values) are removed. FFFFiiiilllleeeennnnaaaammmmeeee GGGGeeeennnneeeerrrraaaattttiiiioooonnnn Following substitution, each command _w_o_r_d is scanned for the characters _****, _????, and _[[[[ unless the _----_ffff option has been _ssss_eeee_tttt. If one of these characters appears, the word is regarded as a _p_a_t_t_e_r_n. The word is replaced with lexicographically sorted filenames that match the pattern. If no filename is found that matches the pattern, the word is left unchanged. When a _p_a_t_t_e_r_n is used for filename generation, the character _.... at the start of a filename or immediately following a _////, as well as the character _//// itself, must be matched explicitly. In other instances of pattern matching the _//// and _.... are not treated specially. _**** Matches any string, including the null string. PPPPaaaaggggeeee 11110000 sssshhhh((((1111)))) sssshhhh((((1111)))) _???? Matches any single character. _[[[[..._]]]] Matches any one of the enclosed characters. A pair of characters separated by _---- matches any character lexically between the pair, inclusive. If the first character following the opening "[ " is a "!" any character not enclosed is matched. A _---- can be included in the character set by putting it as the first or last character. A _p_a_t_t_e_r_n-_l_i_s_t is a list of one or more patterns separated from each other with a _||||. Composite patterns can be formed with one or more of the following: _????_((((_p_a_t_t_e_r_n-_l_i_s_t_)))) Optionally matches any one of the given patterns. _****_((((_p_a_t_t_e_r_n-_l_i_s_t_)))) Matches zero or more occurrences of the given patterns. _++++_((((_p_a_t_t_e_r_n-_l_i_s_t_)))) Matches one or more occurrences of the given patterns. _@@@@_((((_p_a_t_t_e_r_n-_l_i_s_t_)))) Matches exactly one of the given patterns. _!!!!_((((_p_a_t_t_e_r_n-_l_i_s_t_)))) Matches anything, except one of the given patterns. QQQQuuuuoooottttiiiinnnngggg Each of the _m_e_t_a_c_h_a_r_a_c_t_e_r_s listed above (see Definitions above) has a special meaning to the shell and causes termination of a word unless quoted. A character may be _q_u_o_t_e_d (that is, made to stand for itself) by preceding it with a _\\\\. The pair _\\\\_nnnn_eeee_wwww_llll_iiii_nnnn_eeee is removed. All characters enclosed between a pair of single quote marks (_''''_''''), are quoted. A single quote cannot appear within single quotes. Inside double quote marks (_""""_""""), parameter and command substitution occurs and _\\\\ quotes the characters _\\\\, _````, _"""", and _$$$$. The meaning of _$$$$_**** and _$$$$_@@@@ is identical when not quoted or when used as a variable assignment value or as a filename. However, when used as a command argument, _""""_$$$$_****_"""" is equivalent to _""""_$$$$_1111_d_$$$$_2222_d..._"""", where _d is the first character of the _IIII_FFFF_SSSS variable, whereas _""""_$$$$_@@@@_"""" is equivalent to _""""_$$$$_1111_""""_d_""""_$$$$_2222_""""_d_...._...._.... . Inside grave quote marks (_````_````) _\\\\ quotes the characters _\\\\, _````, and _$$$$. If the grave quotes occur within double quotes, _\\\\ also quotes the character _"""". The special meaning of reserved words or aliases can be removed by quoting any character of the reserved word. The recognition of function names or special command names listed below cannot be altered by quoting them. AAAArrrriiiitttthhhhmmmmeeeettttiiiicccc EEEEvvvvaaaalllluuuuaaaattttiiiioooonnnn An ability to perform integer arithmetic is provided with the special command _llll_eeee_tttt. Evaluations are performed using _l_o_n_g arithmetic. Constants are of the form [_b_a_s_e_####]_n where _b_a_s_e is a decimal number between two and thirty-six representing the arithmetic base and _n is a number in that base. If _b_a_s_e_#### is omitted base 10 is used. PPPPaaaaggggeeee 11111111 sssshhhh((((1111)))) sssshhhh((((1111)))) An arithmetic expression uses the same syntax, precedence, and associativity of expression of the C language. All the integral operators, other than _++++_++++, _----_----, _????_::::, and _,,,, are supported. Variables can be referenced by name within an arithmetic expression without using the parameter substitution syntax. When a variable is referenced, its value is evaluated as an arithmetic expression. An internal integer representation of a _v_a_r_i_a_b_l_e can be specified with the _----_iiii option of the _tttt_yyyy_pppp_eeee_ssss_eeee_tttt special command. Arithmetic evaluation is performed on the value of each assignment to a variable with the _----_iiii attribute. If you do not specify an arithmetic base, the first assignment to the variable determines the arithmetic base. This base is used when parameter substitution occurs. Since many of the arithmetic operators require quoting, an alternative form of the _llll_eeee_tttt command is provided. For any command which begins with a _((((_((((, all the characters until a matching _))))_)))) are treated as a quoted expression. More precisely, _((((_((((..._))))_)))) is equivalent to _llll_eeee_tttt _""""..._"""". PPPPrrrroooommmmppppttttiiiinnnngggg When used interactively, the shell prompts with the parameter expanded value of _PPPP_SSSS_1111 before reading a command. If at any time a newline is typed and further input is needed to complete a command, the secondary prompt (that is, the value of _PPPP_SSSS_2222) is issued. CCCCoooonnnnddddiiiittttiiiioooonnnnaaaallll EEEExxxxpppprrrreeeessssssssiiiioooonnnnssss A _c_o_n_d_i_t_i_o_n_a_l _e_x_p_r_e_s_s_i_o_n is used with the _[[[[_[[[[ compound command to test attributes of files and to compare strings. Word splitting and filename generation are not performed on the words between _[[[[_[[[[ and _]]]]_]]]]. Each expression can be constructed from one or more of the following unary or binary expressions: _----_aaaa _f_i_l_e True, if _f_i_l_e exists. _----_bbbb _f_i_l_e True, if _f_i_l_e exists and is a block special file. _----_cccc _f_i_l_e True, if _f_i_l_e exists and is a character special file. _----_dddd _f_i_l_e True, if _f_i_l_e exists and is a directory. _----_eeee _f_i_l_e Same as -a file. _----_ffff _f_i_l_e True, if _f_i_l_e exists and is an ordinary file. _----_gggg _f_i_l_e True, if _f_i_l_e exists and is has its setgid bit set. _----_kkkk _f_i_l_e True, if _f_i_l_e exists and is has its sticky bit set. _----_nnnn _s_t_r_i_n_g True, if length of _s_t_r_i_n_g is nonzero. _----_oooo _o_p_t_i_o_n True, if option named _o_p_t_i_o_n is on. _----_pppp _f_i_l_e True, if _f_i_l_e exists and is a fifo special file or a pipe. _----_rrrr _f_i_l_e True, if _f_i_l_e exists and is readable by current process. _----_ssss _f_i_l_e True, if _f_i_l_e exists and has size greater than zero. _----_tttt _f_i_l_d_e_s True, if file descriptor number _f_i_l_d_e_s is open and associated with a terminal device. _----_uuuu _f_i_l_e True, if _f_i_l_e exists and is has its setuid bit set. PPPPaaaaggggeeee 11112222 sssshhhh((((1111)))) sssshhhh((((1111)))) _----_wwww _f_i_l_e True, if _f_i_l_e exists and is writable by current process. _----_xxxx _f_i_l_e True, if _f_i_l_e exists and is executable by current process. If _f_i_l_e exists and is a directory, the current process has permission to search in the directory. _----_zzzz _s_t_r_i_n_g True, if length of _s_t_r_i_n_g is zero. _----_LLLL _f_i_l_e True, if _f_i_l_e exists and is a symbolic link. _----_OOOO _f_i_l_e True, if _f_i_l_e exists and is owned by the effective user id of this process. _----_GGGG _f_i_l_e True, if _f_i_l_e exists and its group matches the effective group id of this process. _----_SSSS _f_i_l_e True, if _f_i_l_e exists and is a socket. _f_i_l_e_1 _----_nnnn_tttt _f_i_l_e_2 True, if _f_i_l_e_1 exists and is newer than _f_i_l_e_2. _f_i_l_e_1 _----_oooo_tttt _f_i_l_e_2 True, if _f_i_l_e_1 exists and is older than _f_i_l_e_2. _f_i_l_e_1 _----_eeee_ffff _f_i_l_e_2 True, if _f_i_l_e_1 and _f_i_l_e_2 exist and refer to the same file. _s_t_r_i_n_g _==== _p_a_t_t_e_r_n True, if _s_t_r_i_n_g matches _p_a_t_t_e_r_n. _s_t_r_i_n_g _!!!!_==== _p_a_t_t_e_r_n True, if _s_t_r_i_n_g does not match _p_a_t_t_e_r_n. _s_t_r_i_n_g_1 _<<<< _s_t_r_i_n_g_2 True, if _s_t_r_i_n_g_1 comes before _s_t_r_i_n_g_2 based on ASCII value of their characters. _s_t_r_i_n_g_1 _>>>> _s_t_r_i_n_g_2 True, if _s_t_r_i_n_g_1 comes after _s_t_r_i_n_g_2 based on ASCII value of their characters. _e_x_p_1 _----_eeee_qqqq _e_x_p_2 True, if _e_x_p_1 is equal to _e_x_p_2. _e_x_p_1 _----_nnnn_eeee _e_x_p_2 True, if _e_x_p_1 is not equal to _e_x_p_2. _e_x_p_1 _----_llll_tttt _e_x_p_2 True, if _e_x_p_1 is less than _e_x_p_2. _e_x_p_1 _----_gggg_tttt _e_x_p_2 True, if _e_x_p_1 is greater than _e_x_p_2. _e_x_p_1 _----_llll_eeee _e_x_p_2 True, if _e_x_p_1 is less than or equal to _e_x_p_2. _e_x_p_1 _----_gggg_eeee _e_x_p_2 True, if _e_x_p_1 is greater than or equal to _e_x_p_2. In each of the above expressions, if _f_i_l_e is of the form _////_dddd_eeee_vvvv_////_ffff_dddd_////_n, where _n is an integer, the test is applied to the open file whose descriptor number is _n. A compound expression can be constructed from these primitives by using any of the following, listed in decreasing order of precedence. _((((_e_x_p_r_e_s_s_i_o_n_)))) True, if _e_x_p_r_e_s_s_i_o_n is true. Used to group expressions. _!!!! _e_x_p_r_e_s_s_i_o_n True if _e_x_p_r_e_s_s_i_o_n is false. _e_x_p_r_e_s_s_i_o_n_1 _&&&&_&&&& _e_x_p_r_e_s_s_i_o_n_2 True, if _e_x_p_r_e_s_s_i_o_n_1 and _e_x_p_r_e_s_s_i_o_n_2 are both true. _e_x_p_r_e_s_s_i_o_n_1 _||||_|||| _e_x_p_r_e_s_s_i_o_n_2 True, if either _e_x_p_r_e_s_s_i_o_n_1 or _e_x_p_r_e_s_s_i_o_n_2 is true. IIIInnnnppppuuuutttt////OOOOuuuuttttppppuuuutttt Before a command is executed, its input and output may be redirected using a special notation interpreted by the shell. The following may appear anywhere in a simple-command or may precede or follow a _c_o_m_m_a_n_d PPPPaaaaggggeeee 11113333 sssshhhh((((1111)))) sssshhhh((((1111)))) and are not passed on to the invoked command. Command and parameter substitution occurs before _w_o_r_d or _d_i_g_i_t is used except as noted below. Filename generation occurs only if the pattern matches a single file and blank interpretation is not performed. _<<<<_w_o_r_d Use file _w_o_r_d as standard input (file descriptor 0). _>>>>_w_o_r_d Use file _w_o_r_d as standard output (file descriptor 1). If the file does not exist it is created. If the file exists, is a regular file, and the _nnnn_oooo_cccc_llll_oooo_bbbb_bbbb_eeee_rrrr option is on, this causes an error; otherwise, it is truncated to zero length. _>>>>_||||_w_o_r_d Sames as _>>>>, except that it overrides the _nnnn_oooo_cccc_llll_oooo_bbbb_bbbb_eeee_rrrr option. _>>>>_>>>>_w_o_r_d Use file _w_o_r_d as standard output. If the file exists output is appended to it (by first seeking to the end-of-file); otherwise, the file is created. _<<<<_>>>>_w_o_r_d Open file _w_o_r_d for reading and writing as standard input. _<<<<_<<<<[_----]_w_o_r_d The shell input is read up to a line that is the same as _w_o_r_d, or to an end-of-file. No parameter substitution, command substitution or filename generation is performed on _w_o_r_d. The resulting document, called a _h_e_r_e-_d_o_c_u_m_e_n_t, becomes the standard input. If any character of _w_o_r_d is quoted, no interpretation is placed upon the characters of the document; otherwise, parameter and command substitution occurs, _\\\\_nnnn_eeee_wwww_llll_iiii_nnnn_eeee is ignored, and _\\\\ must be used to quote the characters _\\\\, _$$$$, _````, and the first character of _w_o_r_d. If _---- is appended to _<<<<_<<<<, all leading tabs are stripped from _w_o_r_d and from the document. _<<<<_&&&&_d_i_g_i_t The standard input is duplicated from file descriptor _d_i_g_i_t [see _dddd_uuuu_pppp(2)]. Similarly for the standard output using _>>>>_&&&& _d_i_g_i_t. _<<<<_&&&&_---- The standard input is closed. Similarly for the standard output using _>>>>_&&&&_----. _<<<<_&&&&_pppp The input from the co-process is moved to standard input. _>>>>_&&&&_pppp The output to the co-process is moved to standard output. If one of the above is preceded by a digit, the file descriptor number referred to is that specified by the digit (instead of the default 0 or 1). For example, _...._...._.... _2222_>>>>_&&&&_1111 means file descriptor 2 is to be opened for writing as a duplicate of file descriptor 1. PPPPaaaaggggeeee 11114444 sssshhhh((((1111)))) sssshhhh((((1111)))) The order in which redirections are specified is significant. The shell evaluates each redirection in terms of the (_f_i_l_e _d_e_s_c_r_i_p_t_o_r, _f_i_l_e) association at the time of evaluation. For example: _...._...._.... _1111_>>>>_f_n_a_m_e _2222_>>>>_&&&&_1111 first associates file descriptor 1 with file _f_n_a_m_e. It then associates file descriptor 2 with the file associated with file descriptor 1 (that is, _f_n_a_m_e). If the order of redirections were reversed, file descriptor 2 is associated with the terminal (assuming file descriptor 1 had been) and then file descriptor 1 is associated with file _f_n_a_m_e. If a command is followed by _&&&& and job control is not active, the default standard input for the command is the empty file _////_dddd_eeee_vvvv_////_nnnn_uuuu_llll_llll. Otherwise, the environment for the execution of a command contains the file descriptors of the invoking shell as modified by input/output specifications. EEEEnnnnvvvviiiirrrroooonnnnmmmmeeeennnntttt The _e_n_v_i_r_o_n_m_e_n_t [see _eeee_nnnn_vvvv_iiii_rrrr_oooo_nnnn(5)] is a list of name-value pairs that is passed to an executed program in the same way as a normal argument list. The names must be _i_d_e_n_t_i_f_i_e_r_s and the values are character strings. The shell interacts with the environment in several ways. On invocation, the shell scans the environment and creates a variable for each name found, giving it the corresponding value and marking it _e_x_p_o_r_t . Executed commands inherit the environment. If the user modifies the values of these variables or creates new ones, using the _eeee_xxxx_pppp_oooo_rrrr_tttt or _tttt_yyyy_pppp_eeee_ssss_eeee_tttt _----_xxxx commands they become part of the environment. The environment seen by any executed command is thus composed of any name-value pairs originally inherited by the shell, whose values may be modified by the current shell, plus any additions which must be noted in _eeee_xxxx_pppp_oooo_rrrr_tttt or _tttt_yyyy_pppp_eeee_ssss_eeee_tttt _----_xxxx commands. The environment for any _s_i_m_p_l_e-_c_o_m_m_a_n_d or function may be augmented by prefixing it with one or more variable assignments. A variable assignment argument is a word of the form _i_d_e_n_t_i_f_i_e_r=_v_a_l_u_e. Thus, the commands: _TTTT_EEEE_RRRR_MMMM_====_4444_5555_0000 _c_m_d _a_r_g_s _((((_eeee_xxxx_pppp_oooo_rrrr_tttt _TTTT_EEEE_RRRR_MMMM_;;;; _TTTT_EEEE_RRRR_MMMM_====_4444_5555_0000_;;;; _c_m_d _a_r_g_s_)))) are equivalent (as far as the above execution of _c_m_d is concerned except for commands listed with one or two asterisks, * or **, in the SSSSppppeeeecccciiiiaaaallll CCCCoooommmmmmmmaaaannnnddddssss section). If the _----_kkkk flag is set, _a_l_l variable assignment arguments are placed in the environment, even if they occur after the command name. The following first prints _aaaa_====_bbbb _cccc and then _cccc_:::: _eeee_cccc_hhhh_oooo _aaaa_====_bbbb _cccc _ssss_eeee_tttt _----_kkkk _eeee_cccc_hhhh_oooo _aaaa_====_bbbb _cccc PPPPaaaaggggeeee 11115555 sssshhhh((((1111)))) sssshhhh((((1111)))) This feature is intended for use with scripts written for early versions of the shell and its use in new scripts is strongly discouraged. It is likely to disappear someday. FFFFuuuunnnnccccttttiiiioooonnnnssss The _ffff_uuuu_nnnn_cccc_tttt_iiii_oooo_nnnn reserved word, described in the Commands section above, is used to define shell functions. Shell functions are read in and stored internally. Alias names are resolved when the function is read. Functions are executed like commands with the arguments passed as positional parameters (see Execution below). Within a function, the special positional parameter $0 may be the name of the invoking program or the name of the function, depending on how the shell is invoked. (See the _CCCC_OOOO_MMMM_PPPP_AAAA_TTTT_IIII_BBBB_IIII_LLLL_IIII_TTTT_YYYY _IIII_SSSS_SSSS_UUUU_EEEE_SSSS section at the end of this document) Functions execute in the same process as the caller and share all files and present working directory with the caller. Traps caught by the caller are reset to their default action inside the function. A trap condition that is not caught or ignored by the function causes the function to terminate and the condition to be passed on to the caller. A trap on _EEEE_XXXX_IIII_TTTT set inside a function is executed after the function completes in the environment of the caller. Ordinarily, variables are shared between the calling program and the function. However, the _tttt_yyyy_pppp_eeee_ssss_eeee_tttt special command used within a function defines local variables whose scope includes the current function and all functions it calls. The special command _rrrr_eeee_tttt_uuuu_rrrr_nnnn is used to return from function calls. Errors within functions return control to the caller. Function identifiers can be listed with the _----_ffff or _++++_ffff option of the _tttt_yyyy_pppp_eeee_ssss_eeee_tttt special command. The text of functions may also be listed with _----_ffff. Function can be undefined with the _----_ffff option of the _uuuu_nnnn_ssss_eeee_tttt special command. Ordinarily, functions are unset when the shell executes a shell script. The _----_xxxx_ffff option of the _tttt_yyyy_pppp_eeee_ssss_eeee_tttt command allows a function to be exported to scripts that are executed without a separate invocation of the shell. Functions that need to be defined across separate invocations of the shell should be specified in the _EEEE_NNNN_VVVV file with the _----_xxxx_ffff option of _tttt_yyyy_pppp_eeee_ssss_eeee_tttt. JJJJoooobbbbssss If the _mmmm_oooo_nnnn_iiii_tttt_oooo_rrrr option of the _ssss_eeee_tttt command is turned on, an interactive shell associates a _j_o_b with each pipeline. It keeps a table of current jobs, printed by the _jjjj_oooo_bbbb_ssss command, and assigns them small integer numbers. The max number of jobs is defined by the systune value 'maxup'. This is determined at shell invocation. When a job is started asynchronously with _&&&&, the shell prints a line which looks like: [1] 1234 indicating that the job which was started asynchronously was job number 1 and had one (top-level) process, whose process id was 1234. PPPPaaaaggggeeee 11116666 sssshhhh((((1111)))) sssshhhh((((1111)))) If you are running a job and wish to do something else you may hit the key _^^^^_ZZZZ (CTRL-z) which sends a STOP signal to the current job. The shell normally indicates that the job has been `Stopped', and prints another prompt. You can manipulate the state of this job, putting it in the background with the _bbbb_gggg command or run some other commands and eventually bring the job back into the foreground with the foreground command _ffff_gggg. A _^^^^_ZZZZ takes effect immediately and is like an interrupt in that pending output and unread input are discarded when it is typed. A job being run in the background stops if it tries to read from the terminal. Background jobs are normally allowed to produce output, but this can be disabled by giving the command ``stty tostop''. If you set this tty option, background jobs stop when they try to produce output like they do when they try to read input. There are several ways to refer to jobs in the shell. A job can be referred to by the process id of any process of the job or by one of the following: _%%%%_n_u_m_b_e_r The job with the given number. _%%%%_s_t_r_i_n_g Any job whose command line begins with _s_t_r_i_n_g. _%%%%_????_s_t_r_i_n_g Any job whose command line contains _s_t_r_i_n_g. _%%%%_%%%% Current job. _%%%%_++++ Equivalent to _%%%%_%%%%. _%%%%_---- Previous job. This shell learns immediately whenever a process changes state. It normally informs you whenever a job becomes blocked so that no further progress is possible, but only just before it prints a prompt. This is done so that it does not otherwise disturb your work. When the monitor mode is on, each background job that completes triggers any trap set for _CCCC_HHHH_LLLL_DDDD. When you try to leave the shell while jobs are running or stopped, you are be warned that `You have stopped(running) jobs.' You may use the _jjjj_oooo_bbbb_ssss command to see what they are. If you do this or immediately try to exit again, the shell does not warn you a second time, and the stopped jobs are terminated. SSSSiiiiggggnnnnaaaallllssss When a command is run in the background (that it, when it is followed by _&&&&) and the job _mmmm_oooo_nnnn_iiii_tttt_oooo_rrrr option is active, the command does not receive INTERRUPT or QUIT signals. When a command is run in the background (that it, when it is followed by _&&&&) and the job _mmmm_oooo_nnnn_iiii_tttt_oooo_rrrr option is not active, the command receives INTERRUPT or QUIT signals but ignores them. Otherwise, signals have the values inherited by the shell from its parent PPPPaaaaggggeeee 11117777 sssshhhh((((1111)))) sssshhhh((((1111)))) (but see also the _tttt_rrrr_aaaa_pppp command below). EEEExxxxeeeeccccuuuuttttiiiioooonnnn Each time a command is executed, the above substitutions are carried out. If the command name matches one of the special commands listed below, it is executed within the current shell process. Next, the command name is checked to see if it matches one of the user defined functions. If it does, the positional parameters are saved and reset to the arguments of the _f_u_n_c_t_i_o_n call. When the _f_u_n_c_t_i_o_n completes or issues a _rrrr_eeee_tttt_uuuu_rrrr_nnnn, the positional parameter list is restored and any trap set on _EEEE_XXXX_IIII_TTTT within the function is executed. The value of a _f_u_n_c_t_i_o_n is the value of the last command executed. A function is also executed in the current shell process. If a command name is not a _s_p_e_c_i_a_l _c_o_m_m_a_n_d or a user defined _f_u_n_c_t_i_o_n, a process is created and an attempt is made to execute the command via _eeee_xxxx_eeee_cccc(2). The shell variable _PPPP_AAAA_TTTT_HHHH defines the search path for the directory containing the command. Alternative directory names are separated by a colon (_::::). The default path is _////_uuuu_ssss_rrrr_////_bbbb_iiii_nnnn_:::: (specifying _////_uuuu_ssss_rrrr_////_bbbb_iiii_nnnn and the current directory in that order). The current directory can be specified by two or more adjacent colons, or by a colon at the beginning or end of the path list. If the command name contains a _//// the search path is not used. Otherwise, each directory in the path is searched for an executable file. If the file has execute permission but is not a directory or an _aaaa_...._oooo_uuuu_tttt file, it is assumed to be a file containing shell commands. A sub-shell is spawned to read it. All non-exported aliases, functions, and variables, are removed in this case. A parenthesized command is executed in a sub-shell without removing non-exported quantities. CCCCoooommmmmmmmaaaannnndddd RRRReeee----eeeennnnttttrrrryyyy The text of the last _HHHH_IIII_SSSS_TTTT_SSSS_IIII_ZZZZ_EEEE (default 128) commands entered from a terminal device is saved in a _h_i_s_t_o_r_y file. The file _$$$$_HHHH_OOOO_MMMM_EEEE_////_...._ssss_hhhh______hhhh_iiii_ssss_tttt_oooo_rrrr_yyyy is used if the file denoted by the _HHHH_IIII_SSSS_TTTT_FFFF_IIII_LLLL_EEEE variable is not set or is not writable. A shell can access the commands of all _i_n_t_e_r_a_c_t_i_v_e shells which use the same named _HHHH_IIII_SSSS_TTTT_FFFF_IIII_LLLL_EEEE. The special command _ffff_cccc is used to list or edit a portion of this file. The portion of the file to be edited or listed can be selected by number or by giving the first character or characters of the command. A single command or range of commands can be specified. If you do not specify an editor program as an argument to _ffff_cccc the value of the variable _FFFF_CCCC_EEEE_DDDD_IIII_TTTT is used. If _FFFF_CCCC_EEEE_DDDD_IIII_TTTT is not defined _////_uuuu_ssss_rrrr_////_bbbb_iiii_nnnn_////_eeee_dddd is used. The edited command(s) is printed and re-executed upon leaving the editor. The editor name _---- is used to skip the editing phase and to re-execute the command. In this case a substitution variable of the form _o_l_d_====_n_e_w can be used to modify the command before execution. For example, if _rrrr is aliased to _''''_ffff_cccc _----_eeee _----_'''', typing `_rrrr _bbbb_aaaa_dddd_====_gggg_oooo_oooo_dddd _cccc' re-executes the most recent command that starts with the letter _cccc, replacing the first occurrence of the string _bbbb_aaaa_dddd with the string _gggg_oooo_oooo_dddd. PPPPaaaaggggeeee 11118888 sssshhhh((((1111)))) sssshhhh((((1111)))) IIIInnnnlllliiiinnnneeee EEEEddddiiiittttiiiinnnngggg OOOOppppttttiiiioooonnnn Normally, each command line entered from a terminal device is simply typed followed by a newline (`RETURN' or `LINE FEED'). If either the _eeee_mmmm_aaaa_cccc_ssss, or _vvvv_iiii option is active, the user can edit the command line. To be in either of these edit modes _ssss_eeee_tttt the corresponding option. An editing option is automatically selected each time the _VVVV_IIII_SSSS_UUUU_AAAA_LLLL or _EEEE_DDDD_IIII_TTTT_OOOO_RRRR variable is assigned a value ending in either of these option names. The editing features require that the user's terminal accept `RETURN' as carriage return without line feed and that a space (` ') must overwrite the current character on the screen. The editing modes implement a concept where the user is looking through a window at the current line. The window width is the value of _CCCC_OOOO_LLLL_UUUU_MMMM_NNNN_SSSS if it is defined, otherwise 80. If the line is longer than the window width minus two, a mark is displayed at the end of the window to notify the user. As the cursor moves and reaches the window boundaries, the window is centered about the cursor. The mark is a _>>>> (<_,,,, _****) if the line extends on the right (left, both) side(s) of the window. The search commands in each edit mode provide access to the history file. Only strings are matched, not patterns, although a leading _^^^^ in the string restricts the match to begin at the first character in the line. EEEEmmmmaaaaccccssss EEEEddddiiiittttiiiinnnngggg MMMMooooddddeeee This mode is entered by enabling either the _e_m_a_c_s or _g_m_a_c_s option. The only difference between these two modes is the way they handle _^^^^_TTTT. To edit, the user moves the cursor to the point needing correction and then inserts or deletes characters or words as needed. All the editing commands are control characters or escape sequences. The notation for control characters is caret ( _^^^^ ) followed by the character. For example, _^^^^_FFFF is the notation for CTRL-_ffff. This is entered by depressing `f' while holding down the `CTRL' (control) key. (The notation _^^^^_???? indicates the DEL (delete) key.) The notation for escape sequences is _MMMM_---- followed by a character. For example, _MMMM_----_ffff (pronounced Meta f) is entered by depressing ESC (ascii _\\\\_0000_3333_3333) followed by `f'. (_MMMM_----_FFFF would be the notation for ESC followed by `SHIFT' (capital) `F'.) All edit commands operate from any place on the line (not just at the beginning). Neither the "RETURN" nor the "LINE FEED" key is entered after edit commands except when noted. _^^^^_FFFF Move cursor forward (right) one character. _MMMM_----_ffff Move cursor forward one word. (The emacs editor's idea of a word is a string of characters consisting of only letters, digits and underscores.) _^^^^_BBBB Move cursor backward (left) one character. _MMMM_----_bbbb Move cursor backward one word. PPPPaaaaggggeeee 11119999 sssshhhh((((1111)))) sssshhhh((((1111)))) _^^^^_AAAA Move cursor to start of line. _^^^^_EEEE Move cursor to end of line. _^^^^_]]]]_c_h_a_r Move cursor forward to character _c_h_a_r on current line. _MMMM_----_^^^^_]]]]_c_h_a_r Move cursor back to character _c_h_a_r on current line. _^^^^_XXXX_^^^^_XXXX Interchange the cursor and mark. _e_r_a_s_e (User defined erase character as defined by the _ssss_tttt_tttt_yyyy(1) command, usually _^^^^_HHHH or _####.) Delete previous character. _^^^^_DDDD Delete current character. _MMMM_----_dddd Delete current word. _MMMM_----_^^^^_HHHH (Meta-backspace) Delete previous word. _MMMM_----_hhhh Delete previous word. _MMMM_----_^^^^_???? (Meta-DEL) Delete previous word (if your interrupt character is _^^^^_???? (DEL, the default) then this command will not work). _^^^^_TTTT Transpose current character with next character in _e_m_a_c_s mode. Transpose two previous characters in _g_m_a_c_s mode. _^^^^_CCCC Capitalize current character. _MMMM_----_cccc Capitalize current word. _MMMM_----_llll Change the current word to lower case. _^^^^_KKKK Delete from the cursor to the end of the line. If preceded by a numerical parameter whose value is less than the current cursor position, then delete from given position up to the cursor. If preceded by a numerical parameter whose value is greater than the current cursor position, then delete from cursor up to given cursor position. _^^^^_WWWW Kill from the cursor to the mark. _MMMM_----_pppp Push the region from the cursor to the mark on the stack. _kkkk_iiii_llll_llll (User defined kill character as defined by the stty command, usually _^^^^_GGGG or _@@@@.) Kill the entire current line. If two _kkkk_iiii_llll_llll characters are entered in succession, all kill characters from then on cause a line feed (useful when using paper terminals). _^^^^_YYYY Restore last item removed from line. (Yank item back to the line.) _^^^^_LLLL Line feed and print current line. _^^^^_@@@@ (Null character) Set mark. _MMMM_----_ssss_pppp_aaaa_cccc_eeee (Meta space) Set mark. _^^^^_JJJJ (New line) Execute the current line. _^^^^_MMMM (Return) Execute the current line. _e_o_f End-of-file character, normally _^^^^_DDDD, is processed as an End-of- file only if the current line is null. _^^^^_PPPP Fetch previous command. Each time _^^^^_PPPP is entered the previous command back in time is accessed. Moves back one line when not on the first line of a multi-line command. _MMMM_----_<<<< Fetch the least recent (oldest) history line. _MMMM_----_>>>> Fetch the most recent (youngest) history line. _^^^^_NNNN Fetch next command line. Each time _^^^^_NNNN is entered the next command line forward in time is accessed. _^^^^_RRRR_s_t_r_i_n_g Reverse search history for a previous command line containing _s_t_r_i_n_g. If a parameter of zero is given, the search is forward. _S_t_r_i_n_g is terminated by a "RETURN" or "NEW LINE". If string is preceded by a _^^^^, the matched line must begin with _s_t_r_i_n_g. If _s_t_r_i_n_g is omitted, then the next command line containing the most recent _s_t_r_i_n_g is accessed. In this case a PPPPaaaaggggeeee 22220000 sssshhhh((((1111)))) sssshhhh((((1111)))) parameter of zero reverses the direction of the search. _^^^^_OOOO Operate - Execute the current line and fetch the next line relative to current line from the history file. _MMMM_----_d_i_g_i_t_s (Escape) Define numeric parameter, the digits are taken as a parameter to the next command. The commands that accept a parameter are _^^^^_FFFF, _^^^^_BBBB, _e_r_a_s_e, _^^^^_CCCC, _^^^^_DDDD, _^^^^_KKKK, _^^^^_RRRR, _^^^^_PPPP, _^^^^_NNNN, _^^^^_]]]], _MMMM_----_...., _MMMM_----_^^^^_]]]], _MMMM_----_____, _MMMM_----_bbbb, _MMMM_----_cccc, _MMMM_----_dddd, _MMMM_----_ffff, _MMMM_----_hhhh _MMMM_----_llll and _MMMM_----_^^^^_HHHH. _MMMM_----_l_e_t_t_e_r Soft-key - Your alias list is searched for an alias by the name ______l_e_t_t_e_r and if an alias of this name is defined, its value will be inserted on the input queue. The _l_e_t_t_e_r must not be one of the above meta-functions. _MMMM_----_]]]]_l_e_t_t_e_r Soft-key - Your alias list is searched for an alias by the name ___________l_e_t_t_e_r and if an alias of this name is defined, its value will be inserted on the input queue. The can be used to program functions keys on many terminals. _MMMM_----_.... The last word of the previous command is inserted on the line. If preceded by a numeric parameter, the value of this parameter determines which word to insert rather than the last word. _MMMM_----_____ Same as _MMMM_----_..... _MMMM_----_**** Attempt file name generation on the current word. An asterisk is appended if the word doesn't match any file or contain any special pattern characters. _MMMM_----_EEEE_SSSS_CCCC File name completion. Replaces the current word with the longest common prefix of all filenames matching the current word with an asterisk appended. If the match is unique, a _//// is appended if the file is a directory and a space is appended if the file is not a directory. _MMMM_----_==== List files matching current word pattern if an asterisk were appended. _^^^^_UUUU Multiply parameter of next command by 4. _\\\\ Escape next character. Editing characters, the user's erase, kill and interrupt (normally _^^^^_????) characters may be entered in a command line or in a search string if preceded by a _\\\\. The _\\\\ removes the next character's editing features (if any). _^^^^_VVVV Display version of the shell. _MMMM_----_#### Insert a _#### at the beginning of the line and execute it. This causes a comment to be inserted in the history file. vvvviiii EEEEddddiiiittttiiiinnnngggg MMMMooooddddeeee There are two typing modes. Initially, when you enter a command you are in the _i_n_p_u_t mode. To edit, the user enters _c_o_n_t_r_o_l mode by typing ESC (_\\\\_0000_3333_3333), moves the cursor to the point needing correction, and inserts or deletes characters or words as needed. Most control commands accept an optional repeat _c_o_u_n_t prior to the command. When in _vvvv_iiii mode on most systems, canonical processing is initially enabled and the command is echoed again if the speed is 1200 baud or greater and it contains any control characters or less than one second has elapsed since the prompt was printed. The ESC character terminates canonical processing for the remainder of the command and the user can modify the command line. This scheme has the advantages of canonical processing with the type-ahead echoing of raw mode. PPPPaaaaggggeeee 22221111 sssshhhh((((1111)))) sssshhhh((((1111)))) If the option _vvvv_iiii_rrrr_aaaa_wwww is also set, the terminal always has canonical processing disabled. IIIInnnnppppuuuutttt EEEEddddiiiitttt CCCCoooommmmmmmmaaaannnnddddssss By default the editor is in input mode. _e_r_a_s_e (User defined erase character as defined by the stty command, usually _^^^^_HHHH or _####.) Delete previous character. _^^^^_WWWW Delete the previous blank separated word. _^^^^_DDDD Terminate the shell. _^^^^_VVVV Escape next character. Editing characters, the user's erase or kill characters may be entered in a command line or in a search string if preceded by a _^^^^_VVVV. The _^^^^_VVVV removes the next character's editing features (if any). _\\\\ Escape the next _e_r_a_s_e or _kkkk_iiii_llll_llll character. MMMMoooottttiiiioooonnnn EEEEddddiiiitttt CCCCoooommmmmmmmaaaannnnddddssss These commands move the cursor. [_c_o_u_n_t]_llll Cursor forward (right) one character. [_c_o_u_n_t]_wwww Cursor forward one alpha-numeric word. [_c_o_u_n_t]_WWWW Cursor to the beginning of the next word that follows a blank. [_c_o_u_n_t]_eeee Cursor to end of word. [_c_o_u_n_t]_EEEE Cursor to end of the current blank delimited word. [_c_o_u_n_t]_hhhh Cursor backward (left) one character. [_c_o_u_n_t]_bbbb Cursor backward one word. [_c_o_u_n_t]_BBBB Cursor to preceding blank separated word. [_c_o_u_n_t]_|||| Cursor to column _c_o_u_n_t. [_c_o_u_n_t]_ffff_c Find the next character _c in the current line. [_c_o_u_n_t]_FFFF_c Find the previous character _c in the current line. [_c_o_u_n_t]_tttt_c Equivalent to _ffff followed by _hhhh. [_c_o_u_n_t]_TTTT_c Equivalent to _FFFF followed by _llll. PPPPaaaaggggeeee 22222222 sssshhhh((((1111)))) sssshhhh((((1111)))) [_c_o_u_n_t]_;;;; Repeats _c_o_u_n_t times, the last single character find command, _ffff, _FFFF, _tttt, or _TTTT. [_c_o_u_n_t]_,,,, Reverses the last single character find command _c_o_u_n_t times. _0000 Cursor to start of line. _^^^^ Cursor to first non-blank character in line. _$$$$ Cursor to end of line. SSSSeeeeaaaarrrrcccchhhh EEEEddddiiiitttt CCCCoooommmmmmmmaaaannnnddddssss These commands access your command history. [_c_o_u_n_t]_kkkk Fetch previous command. Each time _kkkk is entered the previous command back in time is accessed. [_c_o_u_n_t]_---- Equivalent to _kkkk. [_c_o_u_n_t]_jjjj Fetch next command. Each time _jjjj is entered the next command forward in time is accessed. [_c_o_u_n_t]_++++ Equivalent to _jjjj. [_c_o_u_n_t]_GGGG The command number _c_o_u_n_t is fetched. The default is the least recent history command. _////_s_t_r_i_n_g Search backward through history for a previous command containing _s_t_r_i_n_g. _S_t_r_i_n_g is terminated by a "RETURN" or "NEW LINE". If string is preceded by a _^^^^, the matched line must begin with _s_t_r_i_n_g. If _s_t_r_i_n_g is null the previous string is used. _????_s_t_r_i_n_g Same as _//// except that search is in the forward direction. _nnnn Search for next match of the last pattern to _//// or _???? commands. _NNNN Search for next match of the last pattern to _//// or _????, but in reverse direction. Search history for the _s_t_r_i_n_g entered by the previous _//// command. TTTTeeeexxxxtttt MMMMooooddddiiiiffffiiiiccccaaaattttiiiioooonnnn EEEEddddiiiitttt CCCCoooommmmmmmmaaaannnnddddssss These commands modify the line. _aaaa Enter input mode and enter text after the current character. _AAAA Append text to the end of the line. Equivalent to _$$$$_aaaa. PPPPaaaaggggeeee 22223333 sssshhhh((((1111)))) sssshhhh((((1111)))) [_c_o_u_n_t]_cccc_m_o_t_i_o_n _cccc[_c_o_u_n_t]_m_o_t_i_o_n Delete current character through the character that _m_o_t_i_o_n would move the cursor to and enter input mode. If _m_o_t_i_o_n is _cccc, the entire line is deleted and input mode entered. _CCCC Delete the current character through the end of line and enter input mode. Equivalent to _cccc_$$$$. _SSSS Equivalent to _cccc_cccc. _DDDD Delete the current character through the end of line. Equivalent to _dddd_$$$$. [_c_o_u_n_t]_dddd_m_o_t_i_o_n _dddd[_c_o_u_n_t]_m_o_t_i_o_n Delete current character through the character that _m_o_t_i_o_n would move to. If _m_o_t_i_o_n is _dddd, the entire line is deleted. _iiii Enter input mode and insert text before the current character. _IIII Insert text before the beginning of the line. Equivalent to _0000_iiii. [_c_o_u_n_t]_PPPP Place the previous text modification before the cursor. [_c_o_u_n_t]_pppp Place the previous text modification after the cursor. _RRRR Enter input mode and replace characters on the screen with characters you type overlay fashion. [_c_o_u_n_t]_rrrr_c Replace the _c_o_u_n_t character(s) starting at the current cursor position with _c, and advance the cursor. [_c_o_u_n_t]_xxxx Delete current character. [_c_o_u_n_t]_XXXX Delete preceding character. [_c_o_u_n_t]_.... Repeat the previous text modification command. [_c_o_u_n_t]_~~~~ Invert the case of the _c_o_u_n_t character(s) starting at the current cursor position and advance the cursor. [_c_o_u_n_t]_____ Causes the _c_o_u_n_t word of the previous command to be appended and input mode entered. The last word is used if _c_o_u_n_t is omitted. _**** Causes an _**** to be appended to the current word and filename generation attempted. If no match is found, it rings the bell. Otherwise, the word is replaced by the matching pattern and input mode is entered. PPPPaaaaggggeeee 22224444 sssshhhh((((1111)))) sssshhhh((((1111)))) _\\\\ Filename completion. Replaces the current word with the longest common prefix of all filenames matching the current word with an asterisk appended. If the match is unique, a _//// is appended if the file is a directory and a space is appended if the file is not a directory. OOOOtttthhhheeeerrrr EEEEddddiiiitttt CCCCoooommmmmmmmaaaannnnddddssss Miscellaneous commands. [_c_o_u_n_t]_yyyy_m_o_t_i_o_n _yyyy[_c_o_u_n_t]_m_o_t_i_o_n Yank current character through character that _m_o_t_i_o_n would move the cursor to and puts them into the delete buffer. The text and cursor are unchanged. _YYYY Yanks from current position to end of line. Equivalent to _yyyy_$$$$. _uuuu Undo the last text modifying command. _UUUU Undo all the text modifying commands performed on the line. [_c_o_u_n_t]_vvvv Returns the command _ffff_cccc _----_eeee _$$$$_{{{{_VVVV_IIII_SSSS_UUUU_AAAA_LLLL_::::_----_$$$$_{{{{_EEEE_DDDD_IIII_TTTT_OOOO_RRRR_::::_----_vvvv_iiii_}}}}_}}}} _c_o_u_n_t in the input buffer. If _c_o_u_n_t is omitted, the current line is used. _^^^^_LLLL Line feed and print current line. Has effect only in control mode. _^^^^_JJJJ (New line) Execute the current line, regardless of mode. _^^^^_MMMM (Return) Execute the current line, regardless of mode. _#### Sends the line after inserting a _#### in front of the line. Useful for causing the current line to be inserted in the history without being executed. _==== List the filenames that match the current word if an asterisk were appended it. _@@@@_l_e_t_t_e_r Your alias list is searched for an alias by the name ______l_e_t_t_e_r and if an alias of this name is defined, its value is inserted on the input queue for processing. SSSSppppeeeecccciiiiaaaallll CCCCoooommmmmmmmaaaannnnddddssss The following simple-commands are executed in the shell process. Input/output redirection is permitted. Unless otherwise indicated, the output is written on file descriptor 1 and the exit status, when there is no syntax error, is zero. Commands that are followed by one or two asterisks, * or **, are treated specially in the following ways: PPPPaaaaggggeeee 22225555 sssshhhh((((1111)))) sssshhhh((((1111)))) 1. Variable assignment lists preceding the command remain in effect when the command completes. 2. I/O redirections are processed after variable assignments. 3. Errors cause a script that contains them to abort. 4. Words, following a command followed by ** that are in the format of a variable assignment, are expanded with the same rules as a variable assignment. This means that tilde substitution is performed after the _==== sign and word splitting and filename generation are not performed. _:::: [ _a_r_g ... ] * The command only expands parameters. _.... _f_i_l_e [ _a_r_g ... ] * Read the complete _f_i_l_e and execute the commands. The commands are executed in the current shell environment. The search path specified by _PPPP_AAAA_TTTT_HHHH is used to find the directory containing _f_i_l_e. If any arguments _a_r_g are given, they become the positional parameters. Otherwise the positional parameters are unchanged. The exit status is the exit status of the last command executed. _aaaa_llll_iiii_aaaa_ssss [ _----_tttt_xxxx ] [ _n_a_m_e[_====_v_a_l_u_e ] ] ... ** _A_l_i_a_s with no arguments prints the list of aliases in the form _n_a_m_e=_v_a_l_u_e on standard output. An _a_l_i_a_s is defined for each name whose _v_a_l_u_e is given. A trailing space in _v_a_l_u_e causes the next word to be checked for alias substitution. The _----_tttt flag is used to set and list tracked aliases. The value of a tracked alias is the full pathname corresponding to the given _n_a_m_e. The value becomes undefined when the value of _PPPP_AAAA_TTTT_HHHH is reset but the aliases remain tracked. Without the _----_tttt flag, for each _n_a_m_e in the argument list for which no _v_a_l_u_e is given, the name and value of the alias is printed. The _----_xxxx flag is used to set or print exported aliases. An exported alias is defined for scripts invoked by name. The exit status is nonzero if a _n_a_m_e is given, but no value, for which no alias has been defined. _bbbb_gggg [ _j_o_b... ] This command is only on systems that support job control. Puts each specified _j_o_b into the background. The current job is put in the background if _j_o_b is not specified. See JJJJoooobbbbssss for a description of the format of _j_o_b. _bbbb_rrrr_eeee_aaaa_kkkk [ _n ] * Exit from the enclosing _ffff_oooo_rrrr, _wwww_hhhh_iiii_llll_eeee, _uuuu_nnnn_tttt_iiii_llll or _ssss_eeee_llll_eeee_cccc_tttt loop, if any. If _n is specified, break _n levels. _cccc_oooo_mmmm_mmmm_aaaa_nnnn_dddd [ _----_pppp ] _c_o_m_m_a_n_d__n_a_m_e [ _a_r_g_u_m_e_n_t ... ] PPPPaaaaggggeeee 22226666 sssshhhh((((1111)))) sssshhhh((((1111)))) _cccc_oooo_mmmm_mmmm_aaaa_nnnn_dddd [ _----_vvvv _|||| _----_VVVV ] _c_o_m_m_a_n_d__n_a_m_e The _c_o_m_m_a_n_d utility causes the shell to treat the arguments as a simple command, suppressing the shell function lookup. If the _c_o_m_m_a_n_d__n_a_m_e is the same as the name of one of the special builtin utilities, the special properties in the enumerated list at the beginning of SSSSppppeeeecccciiiiaaaallll CCCCoooommmmmmmmaaaannnnddddssss section do not occur. In every other respect, if _c_o_m_m_a_n_d__n_a_m_e is not the name of a function, the effect of _c_o_m_m_a_n_d are the same as omitting _c_o_m_m_a_n_d. The _----_pppp option performs the search using a default value for _P_A_T_H that is guaranteed to find all of the standard utilities. The _----_vvvv option writes a string to standard output that indicates the pathname or command that will be used by the shell, in the current execution environment, to invoke _c_o_m_m_a_n_d__n_a_m_e. The _----_VVVV option writes a string to standard output that indicates how the name given in the _c_o_m_m_a_n_d__n_a_m_e operand is interpreted by the shell in the current shell execution environment. It indicates in which of the following categories _c_o_m_m_a_n_d__n_a_m_e falls and include the information stated: Utilities, regular builtin utilities, and any implementation- provided functions that are found using the _P_A_T_H variable are identified as such and include the absolute pathname in the string. Other shell functions are identified as functions. Aliases are identified as aliases and their definitions are included in the string. Special builtin utilities are identified as special builtin utilities. Regular builtin utilities not associated with a _P_A_T_H search are identified as regular builtin utilities. Shell reserved words are identified as reserved words. _cccc_oooo_nnnn_tttt_iiii_nnnn_uuuu_eeee [ _n ] * Resume the next iteration of the enclosing _ffff_oooo_rrrr, _wwww_hhhh_iiii_llll_eeee, _uuuu_nnnn_tttt_iiii_llll or _ssss_eeee_llll_eeee_cccc_tttt loop. If _n is specified, resume at the _n-th enclosing loop. _cccc_dddd _[[[[ _----_LLLL_PPPP _]]]] _a_r_g _cccc_dddd _[[[[ _----_LLLL_PPPP _]]]] _o_l_d _n_e_w This command can be in either of two forms. In the first form it changes the current directory to _a_r_g. If _a_r_g is _---- the directory is changed to the previous directory. The shell variable _HHHH_OOOO_MMMM_EEEE is the default _a_r_g. The variable _PPPP_WWWW_DDDD is set to the current directory. The shell variable _CCCC_DDDD_PPPP_AAAA_TTTT_HHHH defines the search path for the directory containing _a_r_g. Alternative directory names are separated by a colon (_::::). The default path is _<<<<_nnnn_uuuu_llll_llll_>>>> (specifying the current PPPPaaaaggggeeee 22227777 sssshhhh((((1111)))) sssshhhh((((1111)))) directory). Note that the current directory is specified by a null pathname, which can appear immediately after the equal sign or between the colon delimiters anywhere else in the path list. If _a_r_g begins with a _//// the search path is not used. Otherwise, each directory in the path is searched for _a_r_g. The second form of _cccc_dddd substitutes the string _n_e_w for the string _o_l_d in the current directory name, _PPPP_WWWW_DDDD and tries to change to this new directory. If you specify _----_LLLL, _ssss_hhhh does not resolve symbolic links. This is the default behavior. If you specify _----_PPPP, _ssss_hhhh resolves all symbolic links. If you specify both _----_LLLL and _----_PPPP, the last option specifies the behavior. The _cccc_dddd command may not be executed by restricted _ssss_hhhh. _eeee_cccc_hhhh_oooo [ _a_r_g ... ] See _eeee_cccc_hhhh_oooo(1) for usage and description. _eeee_vvvv_aaaa_llll [ _a_r_g ... ] * The arguments are read as input to the shell and the resulting command(s) executed. _eeee_xxxx_eeee_cccc [ _a_r_g ... ] * If _a_r_g is given, the command specified by the arguments is executed in place of this shell without creating a new process. Input/output arguments may appear and affect the current process. If no arguments are given the effect of this command is to modify file descriptors as prescribed by the input/output redirection list. In this case, any file descriptor numbers greater than 2 that are opened with this mechanism are closed when invoking another program. _eeee_xxxx_iiii_tttt [ _n ] * Causes the shell to exit with the exit status specified by _n. If _n is omitted the exit status is that of the last command executed. An end-of-file also causes the shell to exit except for a shell which has the _i_g_n_o_r_e_e_o_f option (see _ssss_eeee_tttt below) turned on. _eeee_xxxx_pppp_oooo_rrrr_tttt [ _n_a_m_e[_====_v_a_l_u_e ] ] ... ** The given _n_a_m_es are marked for automatic export to the _e_n_v_i_r_o_n_m_e_n_t of subsequently-executed commands. _eeee_xxxx_pppp_oooo_rrrr_tttt _----_pppp ** When _----_pppp is specified, _e_x_p_o_r_t writes to the standard the output names and values of all exported variables, in the following format: PPPPaaaaggggeeee 22228888 sssshhhh((((1111)))) sssshhhh((((1111)))) "export %s=%s\n",< _n_a_m_e >, < _v_a_l_u_e > The _----_pppp option allows portable access to the values that can be saved and later restored using, for instance, a dot script. The shell formats the output, including the proper use of quoting, so that it is suitable for reinput to the shell as commands that achieve the same exporting results. _ffff_cccc [ _----_eeee _e_n_a_m_e ] [ _----_nnnn_llll_rrrr ] [ _f_i_r_s_t [ _l_a_s_t ] ] _ffff_cccc _----_eeee _---- [ _o_l_d_====_n_e_w ] [ _c_o_m_m_a_n_d ] _ffff_cccc _----_ssss [ _o_l_d_====_n_e_w ] [ _f_i_r_s_t ] In the first form, a range of commands from _f_i_r_s_t to _l_a_s_t is selected from the last _HHHH_IIII_SSSS_TTTT_SSSS_IIII_ZZZZ_EEEE commands that were typed at the terminal. The arguments _f_i_r_s_t and _l_a_s_t may be specified as a [+]number or as a string. A string is used to locate the most recent command starting with the given string. A negative number is used as an offset to the current command number. If the flag _----_llll, is selected, the commands are listed on standard output. Otherwise, the editor program _e_n_a_m_e is invoked on a file containing these keyboard commands. If _e_n_a_m_e is not supplied, the value of the variable _FFFF_CCCC_EEEE_DDDD_IIII_TTTT (default _////_uuuu_ssss_rrrr_////_bbbb_iiii_nnnn_////_eeee_dddd) is used as the editor. When editing is complete, the edited command(s) is executed. If _l_a_s_t is not specified it is set to _f_i_r_s_t. If _f_i_r_s_t is not specified the default is the previous command for editing and -16 for listing. The flag _----_rrrr reverses the order of the commands and the flag _----_nnnn suppresses command numbers when listing. In the second form the _c_o_m_m_a_n_d is re-executed after the substitution _o_l_d_====_n_e_w is performed. In the third form the _c_o_m_m_a_n_d is re-executed after the substitution _o_l_d_====_n_e_w is performed without invoking an editor. _ffff_gggg [ _j_o_b... ] This command is only on systems that support job control. Each _j_o_b specified is brought to the foreground. Otherwise, the current job is brought into the foreground. See JJJJoooobbbbssss for a description of the format of _j_o_b. _gggg_eeee_tttt_oooo_pppp_tttt_ssss _o_p_t_s_t_r_i_n_g _n_a_m_e [ _a_r_g ... ] Checks _a_r_g for legal options. If _a_r_g is omitted, the positional parameters are used. An option argument begins with a _++++ or a _----. An option not beginning with _++++ or _---- or the argument _----_---- ends the options. _o_p_t_s_t_r_i_n_g contains the letters that _gggg_eeee_tttt_oooo_pppp_tttt_ssss recognizes. If a letter is followed by a _::::, that option is expected to have an argument. The options can be separated from the argument by blanks. _gggg_eeee_tttt_oooo_pppp_tttt_ssss places the next option letter it finds inside variable _n_a_m_e each time it is invoked with a _++++ prepended when _a_r_g begins with a _++++. The index of the next _a_r_g is stored in _OOOO_PPPP_TTTT_IIII_NNNN_DDDD. The option argument, if any, gets stored in _OOOO_PPPP_TTTT_AAAA_RRRR_GGGG. Whenever the shell is invoked, _OOOO_PPPP_TTTT_IIII_NNNN_DDDD is initialized to 1. PPPPaaaaggggeeee 22229999 sssshhhh((((1111)))) sssshhhh((((1111)))) A leading _:::: in _o_p_t_s_t_r_i_n_g causes _gggg_eeee_tttt_oooo_pppp_tttt_ssss to store the letter of an invalid option in _OOOO_PPPP_TTTT_AAAA_RRRR_GGGG, and to set _n_a_m_e to _???? for an unknown option and to _:::: when a required option is missing. Otherwise, _gggg_eeee_tttt_oooo_pppp_tttt_ssss prints an error message. The exit status is nonzero when there are no more options. _jjjj_oooo_bbbb_ssss [ _----_llll_nnnn_pppp ] [ _j_o_b ... ] Lists information about each given job; or all active jobs if _j_o_b is omitted. The _----_llll flag lists process ids in addition to the normal information. The _----_nnnn flag only displays jobs that have stopped or exited since last notified. The _----_pppp flag causes only the process group to be listed. See JJJJoooobbbbssss for a description of the format of _j_o_b. _kkkk_iiii_llll_llll [ -_s_i_g ] _j_o_b ... _kkkk_iiii_llll_llll [ -_s_i_g ] -1 _kkkk_iiii_llll_llll _----_ssss _s_i_g_n_a_l__n_a_m_e _j_o_b ... _kkkk_iiii_llll_llll _----_llll [ _e_x_i_t__s_t_a_t_u_s ] Sends either the TERM (terminate) signal or the specified signal to the specified jobs or processes. In the second form, the TERM (terminate) or specified signal is sent to all processes owned by the user. Signals are either given by number or by names (as given in _////_uuuu_ssss_rrrr_////_iiii_nnnn_cccc_llll_uuuu_dddd_eeee_////_ssss_iiii_gggg_nnnn_aaaa_llll_...._hhhh, stripped of the prefix ``SIG''). If the signal being sent is TERM (terminate) or HUP (hangup), the job or process is sent a CONT (continue) signal if it is stopped. The argument _j_o_b can the process id of a process that is not a member of one of the active jobs. See JJJJoooobbbbssss for a description of the format of _j_o_b. In the fourth form, _kkkk_iiii_llll_llll _----_llll, the signal numbers and names are listed. If an _e_x_i_t__s_t_a_t_u_s operand is given and it is the unsigned decimal integer value of a signal number, the _s_i_g_n_a_l__n_a_m_e (the specification-defined symbolic constant name without the ``SIG'' prefix) corresponding to that signal is written. _llll_eeee_tttt _a_r_g ... Each _a_r_g is a separate _a_r_i_t_h_m_e_t_i_c _e_x_p_r_e_s_s_i_o_n to be evaluated. See AAAArrrriiiitttthhhhmmmmeeeettttiiiicccc EEEEvvvvaaaalllluuuuaaaattttiiiioooonnnn above, for a description of arithmetic expression evaluation. The exit status is 0 if the value of the last expression is nonzero, and 1 otherwise. _llll_iiii_mmmm_iiii_tttt [ _----_hhhh ] _r_e_s_o_u_r_c_e _m_a_x_i_m_u_m-_u_s_e This is the Bourne shell version included for backward compatibility. Limits the consumption by the current process and each process it creates to not individually exceed _m_a_x_i_m_u_m-_u_s_e on the specified _r_e_s_o_u_r_c_e. If no _m_a_x_i_m_u_m-_u_s_e is given, then the current limit is printed; if no _r_e_s_o_u_r_c_e is given, then all limitations are given. If the ----hhhh flag is given, the hard limits are used instead of the current limits. The hard limits impose a ceiling on the values of the current limits. Only the superuser can raise the hard limits, but a user can lower or raise the current limits within the legal range. PPPPaaaaggggeeee 33330000 sssshhhh((((1111)))) sssshhhh((((1111)))) Resources controllable currently include _c_p_u_t_i_m_e, the maximum number of cpu-seconds to be used by each process, _f_i_l_e_s_i_z_e, the largest single file that can be created, _d_a_t_a_s_i_z_e, the maximum growth of the data region via _s_b_r_k(2) beyond the end of the program text, _s_t_a_c_k_s_i_z_e, the maximum size of the automatically-extended stack region, _c_o_r_e_d_u_m_p_s_i_z_e, the size of the largest core dump created, _m_e_m_o_r_y_u_s_e, the maximum amount of physical memory a process can have allocated to it at a given time, _d_e_s_c_r_i_p_t_o_r_s, the maximum number of open files, _v_m_e_m_o_r_y, the maximum total virtual size of the process, including text, data, heap, shared memory, mapped files, stack, and so on, and _t_h_r_e_a_d_s, the maximum number of _p_t_h_r_e_a_d_s(5) the process may create. The _m_a_x_i_m_u_m-_u_s_e can be given as a (floating point or integer) number followed by a scale factor. For all limits other than _c_p_u_t_i_m_e, _d_e_s_c_r_i_p_t_o_r_s and _t_h_r_e_a_d_s the default scale is kkkk or kkkkiiiilllloooobbbbyyyytttteeeessss (1024 bytes); a scale factor of mmmm or mmmmeeeeggggaaaabbbbyyyytttteeeessss can also be used. For _c_p_u_t_i_m_e the default scaling is sssseeeeccccoooonnnnddddssss, while mmmm for minutes or hhhh for hours, or a time of the form _m_m::::_s_s giving minutes and seconds can be used. For both _r_e_s_o_u_r_c_e names and scale factors, unambiguous prefixes of the names suffice. _nnnn_eeee_wwww_gggg_rrrr_pppp [ _----_llll ] [ _a_r_g ] * _nnnn_eeee_wwww_gggg_rrrr_pppp [ _---- ] [ _a_r_g ] * Equivalent to _eeee_xxxx_eeee_cccc _////_uuuu_ssss_rrrr_////_bbbb_iiii_nnnn_////_nnnn_eeee_wwww_gggg_rrrr_pppp _a_r_g. The _----_llll (ell) or the _---- option change the environment to what would be expected if the user actually logged in again. _pppp_rrrr_iiii_nnnn_tttt [ _----_RRRR_nnnn_pppp_rrrr_ssss_uuuu[_n ] ] [ _a_r_g ... ] The shell output mechanism. With no flags or with flag _---- or _----_---- the arguments are printed on standard output as described by _eeee_cccc_hhhh_oooo(1). In raw mode, _----_RRRR or _----_rrrr, the escape conventions of _eeee_cccc_hhhh_oooo are ignored. The _----_RRRR option prints all subsequent arguments and options other than _----_nnnn. The _----_pppp option causes the arguments to be written onto the pipe of the process spawned with _||||_&&&& instead of standard output. The _----_ssss option causes the arguments to be written onto the history file instead of standard output. The _----_uuuu flag can be used to specify a one digit file descriptor unit number _nnnn on which the output is placed. The default is 1. If the flag _----_nnnn is used, no newline is added to the output. _pppp_wwww_dddd _[[[[ _----_LLLL_PPPP _]]]] This is equivalent to _pppp_rrrr_iiii_nnnn_tttt _----_rrrr _---- _$$$$_PPPP_WWWW_DDDD if you have not changed _PPPP_WWWW_DDDD. If you specify _----_LLLL, _ssss_hhhh does not resolve symbolic links. This is the default behavior. If you specify _----_PPPP, _ssss_hhhh resolves all symbolic links. PPPPaaaaggggeeee 33331111 sssshhhh((((1111)))) sssshhhh((((1111)))) If you specify both _----_LLLL and _----_PPPP, the last option specifies the behavior. _rrrr_eeee_aaaa_dddd [ _----_pppp_rrrr_ssss_uuuu[ _n ] ] [ _n_a_m_e_????_p_r_o_m_p_t ] [ _n_a_m_e ... ] The shell input mechanism. One line is read and is broken up into fields using the characters in _IIII_FFFF_SSSS as separators. In raw mode, _----_rrrr_,,,, a _\\\\ at the end of a line does not signify line continuation. The first field is assigned to the first _n_a_m_e, the second field to the second _n_a_m_e, and so on, with leftover fields assigned to the last _n_a_m_e. The _----_pppp option causes the input line to be taken from the input pipe of a process spawned by the shell using _||||_&&&&. If the _----_ssss flag is present, the input is saved as a command in the history file. The flag _----_uuuu can be used to specify a one digit file descriptor unit to read from. The file descriptor can be opened with the _eeee_xxxx_eeee_cccc special command. The default value of _n is 0. If _n_a_m_e is omitted _RRRR_EEEE_PPPP_LLLL_YYYY is used as the default _n_a_m_e. The exit status is 0 unless an end-of-file is encountered. An end-of-file with the _----_pppp option causes cleanup for this process so that another can be spawned. If the first argument contains a _????, the remainder of this word is used as a _p_r_o_m_p_t on standard error when the shell is interactive. The exit status is 0 unless an end-of-file is encountered. _rrrr_eeee_aaaa_dddd_oooo_nnnn_llll_yyyy [ _n_a_m_e[_====_v_a_l_u_e] ] ... ** The given _n_a_m_es are marked readonly and these names cannot be changed by subsequent assignment. _rrrr_eeee_aaaa_dddd_oooo_nnnn_llll_yyyy _----_pppp ** When _----_pppp is specified, _r_e_a_d_o_n_l_y writes to the standard the output names and values of all read-only variables, in the following format: "readonly %s=%s\n",< _n_a_m_e >, < _v_a_l_u_e > The _----_pppp option allows portable access to the values that can be saved and later restored using, for instance, a dot script. The shell formats the output, including the proper use of quoting, so that it is suitable for reinput to the shell as commands that achieve the same attribute-setting results. _rrrr_eeee_tttt_uuuu_rrrr_nnnn [ _n ] * Causes a shell _f_u_n_c_t_i_o_n to return to the invoking script with the return status specified by _n. If _n is omitted the return status is that of the last command executed. If _rrrr_eeee_tttt_uuuu_rrrr_nnnn is invoked while not in a _f_u_n_c_t_i_o_n or a _.... script, it is the same as an _eeee_xxxx_iiii_tttt. _ssss_eeee_tttt [ _----_aaaa_bbbb_CCCC_eeee_ffff_hhhh_kkkk_mmmm_nnnn_pppp_ssss_tttt_uuuu_vvvv_xxxx ] [ _----_oooo _o_p_t_i_o_n ] [ _----_AAAA _n_a_m_e ] [ _a_r_g ... ] * The flags for this command have meaning as follows: PPPPaaaaggggeeee 33332222 sssshhhh((((1111)))) sssshhhh((((1111)))) _----_AAAA Array assignment. Unset the variable _n_a_m_e and assign values sequentially from the list _a_r_g. If _++++_AAAA is used, the variable _n_a_m_e is not unset first. _----_aaaa All subsequent variables that are defined are automatically exported. _----_bbbb Cause the shell to notify the user asynchronously of background job completions. When the shell notifies the user a job has been completed, it may remove the job's process ID from the list of those known in the current shell execution environment. Asynchronous notification is not enabled by default. _----_CCCC (Upper-case C) Prevent existing files from being overwritten by the shell's > redirection operator. The >| redirection operator overrides this _n_o_c_l_o_b_b_e_r option for an individual file. _----_eeee If a command has a nonzero exit status, execute the _EEEE_RRRR_RRRR trap, if set, and exit. This mode is disabled while reading profiles. _----_ffff Disables filename generation. _----_hhhh Each command becomes a tracked alias when first encountered. _----_kkkk All variable assignment arguments are placed in the environment for a command, not just those that precede the command name. _----_mmmm Background jobs run in a separate process group and a line prints upon completion. The exit status of background jobs is reported in a completion message. On systems with job control, this flag is turned on automatically for interactive shells. _----_nnnn Read commands and check them for syntax errors, but do not execute them. Ignored for interactive shells. _----_oooo The following argument can be one of the following option names: _aaaa_llll_llll_eeee_xxxx_pppp_oooo_rrrr_tttt Same as _----_aaaa. _eeee_rrrr_rrrr_eeee_xxxx_iiii_tttt Same as _----_eeee. _bbbb_gggg_nnnn_iiii_cccc_eeee All background jobs are run at a lower priority. This is the default mode. _eeee_mmmm_aaaa_cccc_ssss Puts you in an _e_m_a_c_s style in-line editor for command entry. PPPPaaaaggggeeee 33333333 sssshhhh((((1111)))) sssshhhh((((1111)))) _iiii_gggg_nnnn_oooo_rrrr_eeee_eeee_oooo_ffff The shell does not exit on end-of-file. The command _eeee_xxxx_iiii_tttt must be used. _kkkk_eeee_yyyy_wwww_oooo_rrrr_dddd Same as _----_kkkk. _mmmm_aaaa_rrrr_kkkk_dddd_iiii_rrrr_ssss All directory names resulting from filename generation have a trailing _//// appended. _mmmm_oooo_nnnn_iiii_tttt_oooo_rrrr Same as _----_mmmm. _nnnn_oooo_cccc_llll_oooo_bbbb_bbbb_eeee_rrrr Same as _----_CCCC. _nnnn_oooo_eeee_xxxx_eeee_cccc Same as _----_nnnn. _nnnn_oooo_gggg_llll_oooo_bbbb Same as _----_ffff. _nnnn_oooo_llll_oooo_gggg Do not save function definitions in history file. _nnnn_oooo_tttt_iiii_ffff_yyyy Same as _----_bbbb. _nnnn_oooo_uuuu_nnnn_ssss_eeee_tttt Same as _----_uuuu. _pppp_rrrr_iiii_vvvv_iiii_llll_eeee_gggg_eeee_dddd Same as _----_pppp. _vvvv_eeee_rrrr_bbbb_oooo_ssss_eeee Same as _----_vvvv. _tttt_rrrr_aaaa_cccc_kkkk_aaaa_llll_llll Same as _----_hhhh. _vvvv_iiii Puts you in insert mode of a _vvvv_iiii style inline editor until you hit escape character _0000_3333_3333. This puts you in move mode. A return sends the line. _vvvv_iiii_rrrr_aaaa_wwww Each character is processed as it is typed in _vvvv_iiii mode. _xxxx_tttt_rrrr_aaaa_cccc_eeee Same as _----_xxxx. If no option name is supplied the current option settings are printed. _----_pppp Disables processing of the _$$$$_HHHH_OOOO_MMMM_EEEE_////_...._pppp_rrrr_oooo_ffff_iiii_llll_eeee file and uses the file _////_eeee_tttt_cccc_////_ssss_uuuu_iiii_dddd______pppp_rrrr_oooo_ffff_iiii_llll_eeee instead of the _EEEE_NNNN_VVVV file. This mode is on whenever the effective uid (gid) is not equal to the real uid (gid). Turning this off causes the effective uid and gid to be set to the real uid and gid. _----_ssss Sort the positional parameters lexicographically. _----_tttt Exit after reading and executing one command. PPPPaaaaggggeeee 33334444 sssshhhh((((1111)))) sssshhhh((((1111)))) _----_uuuu Treat unset parameters as an error when substituting. _----_vvvv Print shell input lines as they are read. _----_xxxx Print commands and their arguments as they are executed. _---- Turns off _----_xxxx and _----_vvvv flags and stops examining arguments for flags. _----_---- Do not change any of the flags; useful in setting _$$$$_1111 to a value beginning with _----. If no arguments follow this flag the positional parameters are unset. Using _++++ rather than _---- causes these flags to be turned off. These flags can also be used upon invocation of the shell. The current set of flags may be found in _$$$$_----. Unless _----_AAAA is specified, the remaining arguments are positional parameters and are assigned, in order, to _$$$$_1111 _$$$$_2222 .... If no arguments are given the names and values of all variables are printed on the standard output. _ssss_hhhh_iiii_ffff_tttt [ _n ] * The positional parameters from _$$$$_n_++++_1111 ... are renamed _$$$$_1111 ..., default _n is 1. The parameter _n can be any arithmetic expression that evaluates to a non-negative number less than or equal to _$$$$_####. _tttt_iiii_mmmm_eeee_ssss * Print the accumulated user and system times for the shell and for processes run from the shell. _tttt_rrrr_aaaa_pppp [ _a_r_g ] [ _s_i_g ] ... * _a_r_g is a command to be read and executed when the shell receives signal(s) _s_i_g. (Note that _a_r_g is scanned once when the trap is set and once when the trap is taken.) Each _s_i_g can be given as a number or as the name of the signal. Trap commands are executed in order of signal number. Any attempt to set a trap on a signal that was ignored on entry to the current shell is ineffective. If _a_r_g is omitted or is _----, all trap(s) _s_i_g are reset to their original values. If _a_r_g is the null string this signal is ignored by the shell and by the commands it invokes. If _s_i_g is _EEEE_RRRR_RRRR, _a_r_g is executed whenever a command has a nonzero exit status. _s_i_g is _DDDD_EEEE_BBBB_UUUU_GGGG _a_r_g is executed after each command. If _s_i_g is _0000 or _EEEE_XXXX_IIII_TTTT and the _tttt_rrrr_aaaa_pppp statement is executed inside the body of a function, the command _a_r_g is executed after the function completes. If _s_i_g is _0000 or _EEEE_XXXX_IIII_TTTT for a _tttt_rrrr_aaaa_pppp set outside any function the command _a_r_g is executed on exit from the shell. The _tttt_rrrr_aaaa_pppp command with no arguments prints a list of commands associated with each signal number. _tttt_yyyy_pppp_eeee_ssss_eeee_tttt [ _++++_____HHHH_LLLL_RRRR_ZZZZ_ffff_iiii_llll_rrrr_tttt_uuuu_xxxx[_n] ] [ _n_a_m_e[_====_v_a_l_u_e ] ] ... ** Sets attributes and values for shell variables. When invoked inside a function, a new instance of the variable _n_a_m_e is created. The parameter value and type are restored when the function completes. The following list of attributes may be specified: PPPPaaaaggggeeee 33335555 sssshhhh((((1111)))) sssshhhh((((1111)))) _----_HHHH This flag provides UNIX to host-name file mapping on non-UNIX machines. _----_LLLL Left justify and remove leading blanks from _v_a_l_u_e. If _n is nonzero it defines the width of the field, otherwise it is determined by the width of the value of first assignment. When the variable is assigned to, it is filled on the right with blanks or truncated, if necessary, to fit into the field. Leading zeros are removed if the _----_ZZZZ flag is also set. The _----_RRRR flag is turned off. _----_RRRR Right justify and fill with leading blanks. If _n is nonzero it defines the width of the field, otherwise it is determined by the width of the value of first assignment. The field is left filled with blanks or truncated from the end if the variable is reassigned. The _LLLL flag is turned off. _----_ZZZZ Right justify and fill with leading zeros if the first non- blank character is a digit and the _----_LLLL flag has not been set. If _n is nonzero it defines the width of the field, otherwise it is determined by the width of the value of first assignment. _----_ffff The names refer to function names rather than variable names. No assignments can be made and the only other valid flags are _----_tttt, _----_uuuu and _----_xxxx. The flag _----_tttt turns on execution tracing for this function. The flag _----_uuuu causes this function to be marked undefined. The _FFFF_PPPP_AAAA_TTTT_HHHH variable is searched to find the function definition when the function is referenced. The flag _----_xxxx allows the function definition to remain in effect across shell procedures invoked by name. _----_iiii Variable is an integer. This makes arithmetic faster. If _n is nonzero it defines the output arithmetic base, otherwise the first assignment determines the output base. _----_llll All upper-case characters converted to lower-case. The upper- case flag, _----_uuuu is turned off. _----_rrrr The given _n_a_m_es are marked readonly and these names cannot be changed by subsequent assignment. _----_tttt Tags the variables. Tags are user definable and have no special meaning to the shell. _----_uuuu All lower-case characters are converted to upper-case characters. The lower-case flag, _----_llll is turned off. _----_xxxx The given _n_a_m_es are marked for automatic export to the _e_n_v_i_r_o_n_m_e_n_t of subsequently-executed commands. PPPPaaaaggggeeee 33336666 sssshhhh((((1111)))) sssshhhh((((1111)))) Using _++++ rather than _---- causes these flags to be turned off. If no _n_a_m_e arguments are given but flags are specified, a list of _n_a_m_e_s (and optionally the _vvvv_aaaa_llll_uuuu_eeee_ssss) of the _v_a_r_i_a_b_l_e_s which have these flags set is printed. (Using _++++ rather than _---- keeps the values from being printed.) If no _n_a_m_es and flags are given, the _n_a_m_e_s and _a_t_t_r_i_b_u_t_e_s of all _v_a_r_i_a_b_l_e_s are printed. _uuuu_llll_iiii_mmmm_iiii_tttt [ _----_[[[[_HHHH_SSSS_]]]]_[[[[_aaaa _|||| _cccc_dddd_ffff_nnnn_ssss_tttt_vvvv_mmmm_pppp_]]]] ] _uuuu_llll_iiii_mmmm_iiii_tttt [ _----_[[[[_HHHH_SSSS_]]]]_[[[[_cccc _|||| _dddd _|||| _ffff _|||| _nnnn _|||| _ssss _|||| _tttt _|||| _vvvv _|||| _mmmm _|||| _pppp_]]]] _]]]] _l_i_m_i_t _uuuu_llll_iiii_mmmm_iiii_tttt prints or sets hard or soft resource limits. These limits are described in _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2). If _l_i_m_i_t is not present, _uuuu_llll_iiii_mmmm_iiii_tttt prints the specified limits. Any number of limits may be printed at one time. The _----_aaaa option prints all limits. If _l_i_m_i_t is present, _uuuu_llll_iiii_mmmm_iiii_tttt sets the specified limit to _l_i_m_i_t. The string _uuuu_nnnn_llll_iiii_mmmm_iiii_tttt_eeee_dddd requests the largest valid limit. Limits may be set for only one resource at a time. Any user may set a soft limit to any value below the hard limit. Any user may lower a hard limit. Only a privileged user may raise a hard limit; see _ssss_uuuu(1M). The _----_HHHH option specifies a hard limit. The _----_SSSS option specifies a soft limit. If neither option is specified, _uuuu_llll_iiii_mmmm_iiii_tttt sets both limits and prints the soft limit. The following options specify the resource whose limits are to be printed or set. If no option is specified, the file size limit is printed or set. _----_cccc maximum core file size (in 512-byte blocks) _----_dddd maximum size of data segment or heap (in kbytes) _----_ffff maximum file size (in 512-byte blocks) _----_nnnn maximum file descriptor plus 1 _----_ssss maximum size of stack segment (in kbytes). Note that if this is set too high, _ssss_pppp_rrrr_oooo_cccc(2) may fail. _----_tttt maximum CPU time (in seconds) _----_vvvv maximum size of virtual memory (in kbytes) _----_mmmm maximum size of resident memory (in kbytes) _----_pppp maximum number of _p_t_h_r_e_a_d_s(5) that process may create. If no option is given, _----_ffff is assumed. PPPPaaaaggggeeee 33337777 sssshhhh((((1111)))) sssshhhh((((1111)))) _uuuu_mmmm_aaaa_ssss_kkkk [ _----_SSSS ][ _m_a_s_k ] The user file-creation mask is set to _m_a_s_k [see _uuuu_mmmm_aaaa_ssss_kkkk(2)]. _m_a_s_k can either be an octal number or a symbolic value as described in _cccc_hhhh_mmmm_oooo_dddd(1). If a symbolic value is given, the new umask value is the complement of the result of applying _m_a_s_k to the complement of the previous umask value. If _m_a_s_k is omitted, the current value of the mask is printed. If _----_SSSS is specified, the symbolic output is in the following format: "u=%s,g=%s,o=%s\n", _o_w_n_e_r, _g_r_o_u_p, _o_t_h_e_r where the three values are permissions combinations of the letters from the set {r,w,x}. _uuuu_nnnn_aaaa_llll_iiii_aaaa_ssss _n_a_m_e ... _uuuu_nnnn_aaaa_llll_iiii_aaaa_ssss _----_aaaa The variables given by the list of _n_a_m_es are removed from the _a_l_i_a_s list. In the second form, all alias definitions are removed from the current shell execution environment. _uuuu_nnnn_llll_iiii_mmmm_iiii_tttt [ _----_hhhh ] _r_e_s_o_u_r_c_e This is the Bourne shell version included for backward compatibility. Removes the limitation on _r_e_s_o_u_r_c_e. If no _r_e_s_o_u_r_c_e is specified, then all _r_e_s_o_u_r_c_e limitations are removed. If ----hhhh is given, the corresponding hard limits are removed. Only the superuser can do this. (See lllliiiimmmmiiiitttt above) _uuuu_nnnn_ssss_eeee_tttt [ _----_ffff_vvvv ] _n_a_m_e ... * The variables given by the list of _n_a_m_es are unassigned, i. e., their values and attributes are erased. Read-only variables cannot be unset. If the flag, _----_vvvv, is set, the names refer to _v_a_r_i_a_b_l_e names. This is the default when no options are specified. If the flag, _----_ffff, is set, the names refer to _f_u_n_c_t_i_o_n names. Unsetting _EEEE_RRRR_RRRR_NNNN_OOOO, _LLLL_IIII_NNNN_EEEE_NNNN_OOOO, _MMMM_AAAA_IIII_LLLL_CCCC_HHHH_EEEE_CCCC_KKKK, _OOOO_PPPP_TTTT_AAAA_RRRR_GGGG, _OOOO_PPPP_TTTT_IIII_NNNN_DDDD, _RRRR_AAAA_NNNN_DDDD_OOOO_MMMM, _SSSS_EEEE_CCCC_OOOO_NNNN_DDDD_SSSS, _TTTT_MMMM_OOOO_UUUU_TTTT, and _____ causes removes their special meaning even if they are subsequently assigned to. In some shell invocations, unsetting variables not previously set or null returns a value of 0. (See the _CCCC_OOOO_MMMM_PPPP_AAAA_TTTT_IIII_BBBB_IIII_LLLL_IIII_TTTT_YYYY _IIII_SSSS_SSSS_UUUU_EEEE_SSSS section at the end of this document.) _wwww_aaaa_iiii_tttt [ _j_o_b ] * Wait for the specified _j_o_b and report its termination status. If _j_o_b is not given all currently active child processes are waited for. The exit status from this command is that of the process waited for. See JJJJoooobbbbssss for a description of the format of _j_o_b. _wwww_hhhh_eeee_nnnn_cccc_eeee [ _----_pppp_vvvv ] _n_a_m_e ... For each _n_a_m_e, indicate how it is interpreted if used as a command name. _----_vvvv produces a more verbose report. PPPPaaaaggggeeee 33338888 sssshhhh((((1111)))) sssshhhh((((1111)))) _----_pppp does a path search for _n_a_m_e even if name is an alias, a function, or a reserved word. IIIInnnnvvvvooooccccaaaattttiiiioooonnnn If the shell is invoked by _eeee_xxxx_eeee_cccc(2), and the first character of argument zero (_$$$$_0000) is _----, the shell is assumed to be a _llll_oooo_gggg_iiii_nnnn shell and commands are read from _////_eeee_tttt_cccc_////_pppp_rrrr_oooo_ffff_iiii_llll_eeee and then from either _...._pppp_rrrr_oooo_ffff_iiii_llll_eeee in the current directory or _$$$$_HHHH_OOOO_MMMM_EEEE_////_...._pppp_rrrr_oooo_ffff_iiii_llll_eeee, if either file exists. Next, commands are read from the filenamed by performing parameter substitution on the value of the environment variable _EEEE_NNNN_VVVV if the file exists. If the _----_ssss flag is not present and _a_r_g is, a path search is performed on the first _a_r_g to determine the name of the script to execute. The script _a_r_g must have read permission and any _ssss_eeee_tttt_uuuu_iiii_dddd and _ssss_eeee_tttt_gggg_iiii_dddd settings are ignored. Commands are read as described below; the following flags are interpreted by the shell when it is invoked: _----_cccc _s_t_r_i_n_g If the _----_cccc flag is present commands are read from _s_t_r_i_n_g. _----_ssss If the _----_ssss flag is present or if no arguments remain, commands are read from the standard input. Shell output, except for the output of the Special commands listed above, is written to file descriptor 2. _----_iiii If the _----_iiii flag is present or if the shell input and output are attached to a terminal (as told by _iiii_oooo_cccc_tttt_llll(2)) this shell is _i_n_t_e_r_a_c_t_i_v_e. In this case TERM is ignored (so that _kkkk_iiii_llll_llll _0000 does not kill an interactive shell) and INTR is caught and ignored (so that _wwww_aaaa_iiii_tttt is interruptible). In all cases, QUIT is ignored by the shell. _----_rrrr If the _----_rrrr flag is present the shell is a restricted shell. The remaining flags and arguments are described under the _ssss_eeee_tttt command above. RRRReeeessssttttrrrriiiicccctttteeeedddd sssshhhh OOOOnnnnllllyyyy The restricted _ssss_hhhh is used to set up login names and execution environments whose capabilities are more controlled than those of the standard shell. The actions of the restricted _ssss_hhhh are identical to those of _ssss_hhhh, except that the following are disallowed: Changing directory [see _cccc_dddd(1)] Setting the value of _SSSS_HHHH_EEEE_LLLL_LLLL, _EEEE_NNNN_VVVV, or _PPPP_AAAA_TTTT_HHHH Specifying path or command names containing _//// Redirecting output (_>>>>, _>>>>_||||_,,,, _<<<<_>>>>_,,,, and _>>>>_>>>>) The restrictions above are enforced after _...._pppp_rrrr_oooo_ffff_iiii_llll_eeee and the _EEEE_NNNN_VVVV files are interpreted. When a command to be executed is found to be a shell procedure, the restricted _ssss_hhhh invokes _ssss_hhhh to execute it. Thus, it is possible to provide to the end-user shell procedures that have access to the full power of PPPPaaaaggggeeee 33339999 sssshhhh((((1111)))) sssshhhh((((1111)))) the standard shell, while imposing a limited menu of commands; this scheme assumes that the end-user does not have write and execute permissions in the same directory. The net effect of these rules is that the writer of the _...._pppp_rrrr_oooo_ffff_iiii_llll_eeee has complete control over user actions, by performing guaranteed setup actions and leaving the user in an appropriate directory (probably not the login directory). The system administrator often sets up a directory of commands (that is, _////_uuuu_ssss_rrrr_////_rrrr_bbbb_iiii_nnnn) that can be safely invoked by the restricted _ssss_hhhh. WARNING: Since the restricted _ssss_hhhh depends on _...._pppp_rrrr_oooo_ffff_iiii_llll_eeee to set up restrictions, and _...._pppp_rrrr_oooo_ffff_iiii_llll_eeee is only interpreted by login shells, allowing a restricted _ssss_hhhh user to access the system in a manor that does not invoke a login shell will allow the user to bypass these restrictions. An example of this type of access is remote shell (See _rrrr_ssss_hhhh______bbbb_ssss_dddd(1C)). EEEEXXXXIIIITTTT SSSSTTTTAAAATTTTUUUUSSSS Errors detected by the shell, such as syntax errors, cause the shell to return a nonzero exit status. Otherwise, the shell returns the exit status of the last command executed (see also the _eeee_xxxx_iiii_tttt command above). If the shell is being used non-interactively, execution of the shell file is abandoned. Run time errors detected by the shell are reported by printing the command or function name and the error condition. If the line number that the error occurred on is greater than one, the line number is also printed in square brackets (_[[[[_]]]]) after the command or function name. If a command is not found, the exit status is _1111_2222_7777. If the command name is found, but it is not an executable utility, the exit status is _1111_2222_6666. Applications that invoke utilities without using the shell should use these exit status values to report similar errors. If a command fails during word expansion or redirection, its exit status is greater than zero. Internally, for purposes of deciding if a command exits with a nonzero exit status, the shell recognizes the entire status value retrieved for the command by the equivalent of the _w_a_i_t() function WEXITSTATUS macro. When reporting the exit status with the special parameter ?, the shell reports the full eight bits of exit status available. The exit status of a command that terminated because it received a signal is reported as greater than _1111_2222_8888_.... FFFFIIIILLLLEEEESSSS /etc/passwd /etc/profile /etc/suid_profile $HOME/_....profile /tmp/sh* /dev/null PPPPaaaaggggeeee 44440000 sssshhhh((((1111)))) sssshhhh((((1111)))) SSSSEEEEEEEE AAAALLLLSSSSOOOO emacs(1), cat(1), cd(1), chmod(1), cut(1), echo(1), env(1), newgrp(1M), paste(1), stty(1), test(1), umask(1), vi(1), dup(2), exec(2), fork(2), ioctl(2), lseek(2), pipe(2), signal(2), ulimit(2), umask(2), wait(2), rand(3C), a.out(4), profile(4), environ(5). Morris I. Bolsky and David G. Korn, _T_h_e _K_o_r_n_S_h_e_l_l _C_o_m_m_a_n_d _a_n_d _P_r_o_g_r_a_m_m_i_n_g _L_a_n_g_u_a_g_e, Prentice Hall, 1989 NNNNOOOOTTTTEEEESSSS If a command that is a _t_r_a_c_k_e_d _a_l_i_a_s is executed and then a command with the same name is installed in a directory in the search path before the directory where the original command was found, the shell continues to _eeee_xxxx_eeee_cccc the original command. Use the _----_tttt option of the _aaaa_llll_iiii_aaaa_ssss command to correct this situation. Some very old shell scripts contain a _^^^^ as a synonym for the pipe character _||||. Using the _ffff_cccc builtin command within a compound command causes the whole command to disappear from the history file. The builtin command _.... _f_i_l_e reads the whole file before any commands are executed. Therefore, _aaaa_llll_iiii_aaaa_ssss and _uuuu_nnnn_aaaa_llll_iiii_aaaa_ssss commands in the file do not apply to any functions defined in the file. Traps are not processed while a job is waiting for a foreground process. Thus, a trap on _CCCC_HHHH_LLLL_DDDD won't be executed until the foreground job terminates. Prior to IRIX Release 5.0, the _rrrr_ssss_hhhh command invoked the restricted shell. This restricted shell command is _////_uuuu_ssss_rrrr_////_llll_iiii_bbbb_////_rrrr_ssss_hhhh and it can be executed by using the full pathname. Beginning with IRIX Release 5.0, the _rrrr_ssss_hhhh command is the remote shell. See _rrrr_ssss_hhhh______bbbb_ssss_dddd(1C). Sometimes, particularly when using wildcards, the shell will fail to execute a command, and complain with the message aaaarrrrgggg lllliiiisssstttt ttttoooooooo lllloooonnnngggg This can often be avoided by using multiple commands, the _x_a_r_g_s(1) command, or by increasing the nnnnccccaaaarrrrggggssss kernel parameter with the _s_y_s_t_u_n_e(1m) command. CCCCOOOOMMMMPPPPAAAATTTTIIIIBBBBIIIILLLLIIIITTTTYYYY IIIISSSSSSSSUUUUEEEESSSS To retain some backward compatibility to the Bourne shell, certain Korn shell features are controlled by how the shell is invoked and/or the current value of the environment variable ______XXXX_PPPP_GGGG. When the shell is invoked as _""""_ssss_hhhh_"""", the following features are performed only when the current value of the ______XXXX_PPPP_GGGG variable is equal to 1 (one): - command substitution of the form "$( command )" - arithmetic expression of the form "$(( expression ))" PPPPaaaaggggeeee 44441111 sssshhhh((((1111)))) sssshhhh((((1111)))) - tilde expansion of pathnames - unsetting variables, not previously set or null, returns 0 When the shell is invoked as _""""_ssss_hhhh_"""" and the current value of the ______XXXX_PPPP_GGGG environment variable is not equal to 1 (one), the special positional parameter $0, within a function call, is the name of the function. Otherwise, it is the name of the invoking shell script. When the shell is not invoked as _""""_ssss_hhhh_"""" and the real and effective uid and gid differ, the effective uid and gid are set to the real uid and gid. With all invocations of the shell, when the current value of the ______XXXX_PPPP_GGGG environment variable is equal to 1 (one), the _----_nnnn option of the builtin _eeee_cccc_hhhh_oooo command does not suppress the terminating newline and is treated as part of the output string. Additional incompatibilities are listed below and can be found in the Appendix of the _""""_TTTT_hhhh_eeee _KKKK_oooo_rrrr_nnnn_ssss_hhhh_eeee_llll_llll _CCCC_oooo_mmmm_mmmm_aaaa_nnnn_dddd _aaaa_nnnn_dddd _PPPP_rrrr_oooo_gggg_rrrr_aaaa_mmmm_mmmm_iiii_nnnn_gggg _LLLL_aaaa_nnnn_gggg_uuuu_aaaa_gggg_eeee_"""" _((((_BBBB_oooo_llll_ssss_kkkk_yyyy _&&&& _KKKK_oooo_rrrr_nnnn_;;;; _PPPP_rrrr_eeee_nnnn_tttt_iiii_cccc_eeee _HHHH_aaaa_llll_llll_)))) The Korn shell is more restrictive with field comparisons in the builtin _tttt_eeee_ssss_tttt command: _[[[[ _""""_1111_0000_2222_4444_0000 _ffff_iiii_llll_eeee_nnnn_aaaa_mmmm_eeee_"""" _----_gggg_eeee _1111_0000_2222_4444_0000 _]]]] is accepted by the Bourne shell whereas the Korn shell gives a syntax error. The Korn shell _kkkk_iiii_llll_llll builtin command now handles the special process number (-1) for all process owned by the user. (See the SSSSppppeeeecccciiiiaaaallll CCCCoooommmmmmmmaaaannnnddddssss section.) The _ffff_aaaa_llll_ssss_eeee command is a builtin for the Korn shell and cannot be defined as a function. The _cccc_hhhh_dddd_iiii_rrrr is a builtin alias to the _cccc_dddd command. When shell is invoked as "ksh", this alias is removed allowing _cccc_hhhh_dddd_iiii_rrrr to be defined as a function. When shell is invoked as "sh", this can also be accomplished by unaliasing _cccc_hhhh_dddd_iiii_rrrr and then defining it as a function. Some Korn shell internal variables are typeset as integers and setting them to non-numeric values will cause "bad number" error messages. They include _EEEE_RRRR_RRRR_NNNN_OOOO_,,,, _LLLL_IIII_NNNN_EEEE_NNNN_OOOO_,,,, _MMMM_AAAA_IIII_LLLL_CCCC_HHHH_EEEE_CCCC_KKKK_,,,, _OOOO_PPPP_TTTT_IIII_NNNN_DDDD_,,,, _PPPP_PPPP_IIII_DDDD_,,,, _RRRR_AAAA_NNNN_DDDD_OOOO_MMMM_,,,, _SSSS_EEEE_CCCC_OOOO_NNNN_DDDD_SSSS _aaaa_nnnn_dddd _TTTT_MMMM_OOOO_UUUU_TTTT_.... The Korn shell evaluates variable assignment lists before I/O redirection unlike the Bourne shell in which order does not matter. The Bourne shell (bsh) has been modified to allow fullpath calls of Bourne shell builtins using the builtin name POSIX links to /sbin/builtin_exec. PPPPaaaaggggeeee 44442222 sssshhhh((((1111)))) sssshhhh((((1111)))) IIIINNNNTTTTEEEERRRRNNNNAAAATTTTIIIIOOOONNNNAAAALLLLIIIIZZZZAAAATTTTIIIIOOOONNNN The shell accepts multibyte input for command line args, file names, environment variable names and values, variable arrays, function names, history files and shell scripts. Multibyte sequences accepted for the _iiii_ssss_pppp_hhhh_oooo_nnnn_oooo_gggg_rrrr_aaaa_mmmm_((((_)))) and _iiii_ssss_iiii_dddd_eeee_oooo_gggg_rrrr_aaaa_mmmm_((((_)))) subroutines are also allowed. _NNNN_oooo_tttt_eeee_:::: The _eeee_mmmm_aaaa_cccc_ssss line editing feature is currently supported only with the default _CCCC/_PPPP_OOOO_SSSS_IIII_XXXX locale. _NNNN_oooo_tttt_eeee_:::: Changing the _LLLL_AAAA_NNNN_GGGG value during a shell session can produce undefined results when accessing e.g. variables created under a different locale. PPPPaaaaggggeeee 44443333